nucypher/.circleci/config.yml

531 lines
16 KiB
YAML
Raw Normal View History

version: 2.0
workflows:
version: 2
test:
jobs:
- pipenv_install:
filters:
tags:
only: /.*/
- pip_install:
filters:
tags:
only: /.*/
- mypy:
filters:
tags:
only: /.*/
- contracts:
context: "NuCypher Tests"
filters:
tags:
only: /.*/
requires:
- pip_install
- pipenv_install
- config:
context: "NuCypher Tests"
filters:
tags:
only: /.*/
requires:
- contracts
- crypto:
context: "NuCypher Tests"
filters:
tags:
only: /.*/
requires:
- pip_install
- pipenv_install
- network:
context: "NuCypher Tests"
filters:
tags:
only: /.*/
requires:
- pip_install
- pipenv_install
- keystore:
context: "NuCypher Tests"
filters:
tags:
only: /.*/
requires:
- pip_install
- pipenv_install
- blockchain_interface:
context: "NuCypher Tests"
filters:
tags:
only: /.*/
requires:
- pip_install
- pipenv_install
- blockchain_entities:
context: "NuCypher Tests"
filters:
tags:
only: /.*/
requires:
- contracts
- agents:
context: "NuCypher Tests"
filters:
tags:
only: /.*/
requires:
- blockchain_interface
- actors:
context: "NuCypher Tests"
filters:
tags:
only: /.*/
requires:
- blockchain_interface
- deployers:
context: "NuCypher Tests"
filters:
tags:
only: /.*/
requires:
- intercontract_integration
- blockchain_interface
- config:
2018-12-01 20:53:00 +00:00
context: "NuCypher Tests"
filters:
tags:
only: /.*/
requires:
- blockchain_interface
- config
- crypto
- network
- keystore
- character
- cli:
context: "NuCypher Tests"
filters:
tags:
only: /.*/
requires:
- actors
- deployers
- config
- character
- ursula_command:
context: "NuCypher Tests"
filters:
tags:
only: /.*/
requires:
- actors
- deployers
- config
- character
#
# TODO: Initial Publication Automation
#
# - test_build:
# filters:
# tags:
# only: /.*/
# requires:
# - cli
# - ursula_command
# - test_deploy:
# context: "NuCypher PyPI"
# requires:
# - test_build
# filters:
# tags:
# only: /v[0-9]+.*/
# branches:
# ignore: /.*/
# - request_publication_approval:
# type: approval
# requires:
# - test_deploy
# filters:
# tags:
# only: /v[0-9]+.*/
# branches:
# ignore: /.*/
# - deploy:
# context: "NuCypher PyPI"
# requires:
# - request_publication_approval
# filters:
# tags:
# only: /v[0-9]+.*/
# branches:
# ignore: /.*/
#
2018-12-04 07:08:55 +00:00
python_36_base: &python_36_base
working_directory: ~/nucypher-depends
docker:
- image: circleci/python:3.6
2018-12-04 07:08:55 +00:00
_run:
coveralls: &coveralls
name: Upload Coverage Report
command: |
echo -e "COVERALLS_REPO_TOKEN=$COVERALLS_REPO_TOKEN" >> .env
pipenv run coveralls
jobs:
pipenv_install:
<<: *python_36_base
steps:
- checkout
- run:
name: Install Python Dependencies with Pipenv
command: |
pip3 install --user pip==18.0
pipenv install --three --dev --skip-lock --pre
- run:
name: Install Solidity Compiler
command: pipenv run ./scripts/install_solc.sh
2018-08-31 17:20:36 +00:00
- persist_to_workspace:
root: ~/.local/share/virtualenvs/
paths:
2018-08-31 17:20:36 +00:00
- nucypher-*
pip_install:
<<: *python_36_base
steps:
- checkout
- run:
name: Install Python Dependencies with Pip
command: |
pip3 install --user .
- run:
name: Install Python Development Dependencies with Pip
command: |
pip3 install --user .[testing]
- run:
name: Install Solidity Compiler
command: ./scripts/install_solc.sh
- run:
name: Check Python Entrypoint
command: python3 -c "import nucypher; print(nucypher.__version__)"
blockchain_interface:
<<: *python_36_base
parallelism: 2
steps:
- checkout
- attach_workspace:
at: ~/.local/share/virtualenvs/
- run:
name: Blockchain Interface Tests
command: pipenv run pytest --cov=nucypher/blockchain/eth -v --runslow tests/blockchain/eth/interfaces --junitxml=./reports/pytest/results.xml
2018-12-04 07:08:55 +00:00
- run: *coveralls
- store_test_results:
path: ./reports/pytest/
agents:
<<: *python_36_base
steps:
- checkout
2018-08-31 17:20:36 +00:00
- attach_workspace:
at: ~/.local/share/virtualenvs/
- run:
name: Blockchain Agent Tests
command: pipenv run pytest --cov=nucypher/blockchain/eth -v --runslow $(circleci tests glob tests/blockchain/eth/entities/agents/**/*.py | circleci tests split --split-by=timings) --junitxml=./reports/pytest/results.xml
- run: *coveralls
- store_test_results:
path: ./reports/pytest/
actors:
<<: *python_36_base
steps:
- checkout
- attach_workspace:
at: ~/.local/share/virtualenvs/
- run:
name: Blockchain Actor Tests
command: pipenv run pytest --cov=nucypher/blockchain/eth -v --runslow $(circleci tests glob tests/blockchain/eth/entities/actors/**/*.py | circleci tests split --split-by=timings) --junitxml=./reports/pytest/results.xml
- run: *coveralls
- store_test_results:
path: ./reports/pytest/
deployers:
<<: *python_36_base
steps:
- checkout
- attach_workspace:
at: ~/.local/share/virtualenvs/
- run:
name: Contract Deployer Tests
command: pipenv run pytest --cov=nucypher/blockchain/eth -v --runslow tests/blockchain/eth/entities/deployers --junitxml=./reports/pytest/results.xml
2018-12-04 07:08:55 +00:00
- run: *coveralls
2018-06-30 07:05:46 +00:00
- store_test_results:
path: ./reports/pytest/
contracts:
<<: *python_36_base
parallelism: 4
steps:
- checkout
2018-08-31 17:20:36 +00:00
- attach_workspace:
at: ~/.local/share/virtualenvs/
- run:
name: Ethereum Contract Unit Tests
command: |
pipenv run pytest --junitxml=./reports/pytest/eth-contract-unit-report.xml -v --runslow $(circleci tests glob tests/blockchain/eth/contracts/**/**/test_*.py | circleci tests split --split-by=timings)
- store_test_results:
path: ./reports/pytest/
config:
<<: *python_36_base
2018-12-01 21:08:08 +00:00
parallelism: 2
steps:
- checkout
- attach_workspace:
at: ~/.local/share/virtualenvs/
- run:
name: Node Configuration Tests
2018-11-28 05:24:17 +00:00
command: |
2018-12-01 21:08:08 +00:00
pipenv run pytest --cov=nucypher/config -v --runslow $(circleci tests glob tests/config/**/test_*.py | circleci tests split --split-by=timings) --junitxml=./reports/pytest/config_results.xml
2018-12-04 07:08:55 +00:00
- run: *coveralls
- store_test_results:
path: ./reports/pytest/
crypto:
<<: *python_36_base
steps:
- checkout
2018-08-31 17:20:36 +00:00
- attach_workspace:
at: ~/.local/share/virtualenvs/
- run:
name: Crypto Character Tests
2018-11-28 05:24:17 +00:00
command: |
2018-12-01 21:08:08 +00:00
pipenv run pytest --cov=nucypher/crypto -v --runslow tests/crypto --junitxml=./reports/pytest/crypto_results.xml
2018-12-04 07:08:55 +00:00
- run: *coveralls
2018-06-30 07:05:46 +00:00
- store_test_results:
path: ./reports/pytest/
network:
<<: *python_36_base
steps:
- checkout
2018-08-31 17:20:36 +00:00
- attach_workspace:
at: ~/.local/share/virtualenvs/
- run:
name: Network Tests
2018-11-28 05:24:17 +00:00
command: |
2018-12-01 21:08:08 +00:00
pipenv run pytest --cov=nucypher/network -v --runslow $(circleci tests glob tests/network/**/test_*.py | circleci tests split --split-by=timings) --junitxml=./reports/pytest/network_results.xml
2018-12-04 07:08:55 +00:00
- run: *coveralls
2018-06-30 07:05:46 +00:00
- store_test_results:
path: ./reports/pytest/
keystore:
<<: *python_36_base
2018-12-01 21:08:08 +00:00
parallelism: 2
steps:
- checkout
2018-08-31 17:20:36 +00:00
- attach_workspace:
at: ~/.local/share/virtualenvs/
- run:
name: Keystore Tests
2018-11-28 05:24:17 +00:00
command: |
2018-12-01 21:08:08 +00:00
pipenv run pytest --cov=nucypher/keystore -v --runslow $(circleci tests glob tests/keystore/**/test_*.py | circleci tests split --split-by=timings) --junitxml=./reports/pytest/keystore_results.xml
2018-12-04 07:08:55 +00:00
- run: *coveralls
2018-06-30 07:05:46 +00:00
- store_test_results:
path: ./reports/pytest/
character:
<<: *python_36_base
2018-12-01 21:08:08 +00:00
parallelism: 4
steps:
- checkout
2018-08-31 17:20:36 +00:00
- attach_workspace:
at: ~/.local/share/virtualenvs/
- run:
name: Character Tests
2018-11-28 05:24:17 +00:00
command: |
2018-12-01 21:08:08 +00:00
pipenv run pytest --cov=nucypher -v --runslow $(circleci tests glob tests/characters/**/test_*.py | circleci tests split --split-by=timings) --junitxml=./reports/pytest/character_results.xml
2018-12-04 07:08:55 +00:00
- run: *coveralls
2018-06-30 07:05:46 +00:00
- store_test_results:
path: ./reports/pytest/
learning:
<<: *python_36_base
steps:
- checkout
- attach_workspace:
at: ~/.local/share/virtualenvs/
- run:
name: Learner Tests
command: pipenv run pytest --cov=nucypher -v --runslow tests/learning --junitxml=./reports/pytest/results.xml
- run: *coveralls
- store_test_results:
path: ./reports/pytest/
intercontract_integration:
<<: *python_36_base
steps:
- checkout
2018-08-31 17:20:36 +00:00
- attach_workspace:
at: ~/.local/share/virtualenvs/
- run:
name: Ethereum Inter-Contract Integration Test
command: |
2018-12-01 21:08:08 +00:00
pipenv run pytest -v --runslow tests/blockchain/eth/contracts/main/test_intercontract_integration.py --junitxml=./reports/pytest/intercontract_integration_results.xml
2018-06-30 07:05:46 +00:00
- store_test_results:
path: ./reports/pytest/
cli:
<<: *python_36_base
2018-12-01 21:08:08 +00:00
parallelism: 4
steps:
- checkout
- attach_workspace:
at: ~/.local/share/virtualenvs/
- run:
name: Nucypher CLI Tests
command: |
2018-12-01 21:08:08 +00:00
pipenv run pytest --cov=nucypher/cli.py -v --runslow $(circleci tests glob tests/cli/**/test_*.py | circleci tests split --split-by=timings) --junitxml=./reports/pytest/cli_results.xml
2018-12-04 07:08:55 +00:00
- run: *coveralls
- store_test_results:
path: ./reports/pytest/
ursula_command:
<<: *python_36_base
steps:
- checkout
- attach_workspace:
at: ~/.local/share/virtualenvs/
- run:
name: Ursula Command Tests
command: |
pipenv run pytest -v --cov=nucypher/cli.py --runslow tests/cli/protocol --junitxml=./reports/pytest/results.xml
- run: *coveralls
- store_test_results:
path: ./reports/pytest/
mypy:
<<: *python_36_base
steps:
- checkout
- attach_workspace:
at: ~/.local/share/virtualenvs/
- run:
name: Install mypy
command: |
pipenv run pip install lxml
pipenv run pip install mypy
- run:
name: Run Mypy Static Type Checks (Always Succeed)
command: |
mkdir ./mypy_reports ./mypy_results
export MYPYPATH=./nucypher
2018-12-01 21:08:08 +00:00
pipenv run mypy ./nucypher --config-file=mypy.ini --xslt-html-report ./mypy_reports/html/ --linecount-report ./mypy_reports/linecount || true
- store_artifacts:
path: ./mypy_reports
test_build:
<<: *python_36_base
steps:
- checkout
- run:
name: Install Dependencies (Test Build)
command: |
pipenv install --three --dev --skip-lock --pre
pipenv install --dev --skip-lock twine
- run:
name: Build Python Wheel
command: |
pipenv run python setup.py sdist
pipenv run python setup.py bdist_wheel -v
- run:
name: Install Nucypher via Wheel
command: |
2018-11-24 03:42:52 +00:00
pip3 install --user ./dist/nucypher-0.1.0a0-py3-none-any.whl[test]
- run:
name: Run Entrypoint Version Commands
2018-11-24 03:42:52 +00:00
command: |
python -c "import nucypher; print(nucypher.__version__)"
nucypher --version
test_deploy:
<<: *python_36_base
steps:
- checkout
- run:
name: Install Dependencies (Test Deploy)
command: |
pipenv install --three --dev --skip-lock --pre
pipenv install --dev --skip-lock twine
- run:
name: Verify git tag == __version__ (Test Deploy)
command: pipenv run python setup.py verify
- run:
name: Initialize .pypirc (Test Deploy)
command: |
echo -e "[distutils]" >> ~/.pypirc
echo -e "index-servers = " >> ~/.pypirc
echo -e " pypi" >> ~/.pypirc
echo -e " testpypi" >> ~/.pypirc
echo -e "" >> ~/.pypirc
echo -e "[testpypi]" >> ~/.pypirc
echo -e "repository: https://test.pypi.org/legacy/" >> ~/.pypirc
echo -e "username: $TEST_PYPI_USERNAME" >> ~/.pypirc
echo -e "password: $TEST_PYPI_PASSWORD" >> ~/.pypirc
- run:
name: Build Python Wheel (Test Deploy)
command: |
pipenv run python setup.py sdist
pipenv run python setup.py bdist_wheel
- run:
name: upload to TestPyPI
command: pipenv run twine upload --repository testpypi dist/* --verbose
- run:
name: pip install from TestPyPI
command: |
pip install --user --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple nucypher --verbose
python -c "import nucypher; print(nucypher.__version__)"
deploy:
<<: *python_36_base
steps:
- checkout
- run:
name: Install dependencies
command: |
pipenv install --three --dev --skip-lock --pre
pipenv install --dev --skip-lock twine
- run:
name: Verify git tag == __version__
command: pipenv run python setup.py verify
- run:
name: Initialize .pypirc
command: |
echo -e "[distutils]" >> ~/.pypirc
echo -e "index-servers = " >> ~/.pypirc
echo -e " pypi" >> ~/.pypirc
echo -e "" >> ~/.pypirc
echo -e "[pypi]" >> ~/.pypirc
echo -e "username = $PYPI_USERNAME" >> ~/.pypirc
echo -e "password = $PYPI_PASSWORD" >> ~/.pypirc
- run:
name: Build Python Wheel
command: |
pipenv run python setup.py sdist
pipenv run python setup.py bdist_wheel
- run:
name: Upload to PyPI
command: pipenv run twine upload dist/* --verbose
- run:
name: pip install from PyPI
command: |
pip install --user nucypher --verbose
python -c "import nucypher; print(nucypher.__version__)"