pyUmbral/.circleci/config.yml

369 lines
11 KiB
YAML
Raw Normal View History

2018-06-21 07:53:19 +00:00
version: 2.0
workflows:
version: 2
2018-08-20 23:38:38 +00:00
build_test_deploy:
2018-06-21 07:53:19 +00:00
jobs:
- bundle_dependencies-35:
filters:
tags:
only: /.*/
- bundle_dependencies-36:
filters:
tags:
only: /.*/
- bundle_dependencies-37:
filters:
tags:
only: /.*/
2018-08-21 20:20:48 +00:00
- run_tests-35:
filters:
tags:
only: /.*/
2018-08-21 20:20:48 +00:00
requires:
- bundle_dependencies-35
- run_tests-36:
filters:
tags:
only: /.*/
2018-08-21 20:20:48 +00:00
requires:
- bundle_dependencies-36
- run_tests-37:
filters:
tags:
only: /.*/
2018-08-21 20:20:48 +00:00
requires:
- bundle_dependencies-37
- mypy_type_check-36:
filters:
tags:
only: /.*/
2018-08-21 20:20:48 +00:00
requires:
- run_tests-35
- run_tests-36
- run_tests-37
- doctests-36:
filters:
tags:
only: /.*/
2018-08-21 20:20:48 +00:00
requires:
- run_tests-35
- run_tests-36
- run_tests-37
- notebook_tests-36:
filters:
tags:
only: /.*/
requires:
- run_tests-35
- run_tests-36
- run_tests-37
2018-08-21 20:20:48 +00:00
- reencryption_memory_profile-36:
filters:
tags:
only: /.*/
2018-08-21 20:20:48 +00:00
requires:
- run_tests-35
- run_tests-36
- run_tests-37
- reencryption_benchmark-36:
filters:
tags:
only: /.*/
2018-08-21 20:20:48 +00:00
requires:
- run_tests-35
- run_tests-36
- run_tests-37
- test_deploy:
context: "NuCypher PyPI"
requires:
2018-08-21 21:32:26 +00:00
- mypy_type_check-36
- doctests-36
filters:
tags:
2018-08-21 20:20:48 +00:00
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-07-06 18:26:27 +00:00
python_35_base: &python_35_base
working_directory: ~/pyUmbral-35
docker:
- image: circleci/python:3.5
python_36_base: &python_36_base
2018-06-21 07:53:19 +00:00
working_directory: ~/pyUmbral-36
docker:
2018-06-21 07:53:19 +00:00
- image: circleci/python:3.6
2018-07-06 18:26:27 +00:00
python_37_base: &python_37_base
working_directory: ~/pyUmbral-37
docker:
- image: circleci/python:3.7
jobs:
2018-07-06 18:26:27 +00:00
bundle_dependencies-35:
<<: *python_35_base
steps:
- checkout
- run:
name: Install Python dependencies with Pipenv
2018-07-06 19:21:53 +00:00
command: pipenv sync --three --dev
2018-07-06 19:47:45 +00:00
- run:
name: Check PEP 508 Requirements
command: pipenv check
2018-07-06 18:26:27 +00:00
- save_cache:
paths:
- "~/.local/share/virtualenvs/"
2018-07-06 19:21:53 +00:00
key: v2-deps-{{ .Environment.CIRCLE_WORKFLOW_ID }}-{{ checksum "Pipfile.lock" }}-py35
bundle_dependencies-36:
<<: *python_36_base
2018-06-21 07:53:19 +00:00
steps:
- checkout
- run:
name: Install Python dependencies with Pipenv
2018-07-06 19:21:53 +00:00
command: pipenv sync --three --dev
2018-07-06 19:47:45 +00:00
- run:
name: Check PEP 508 Requirements
command: pipenv check
2018-06-21 07:53:19 +00:00
- save_cache:
paths:
- "~/.local/share/virtualenvs/"
2018-07-06 19:21:53 +00:00
key: v2-deps-{{ .Environment.CIRCLE_WORKFLOW_ID }}-{{ checksum "Pipfile.lock" }}-py36
2018-06-21 07:53:19 +00:00
2018-07-06 18:26:27 +00:00
bundle_dependencies-37:
<<: *python_37_base
2018-06-21 07:53:19 +00:00
steps:
- checkout
- run:
name: Install Python dependencies with Pipenv
2018-07-06 19:21:53 +00:00
command: pipenv sync --three --dev
2018-07-06 19:47:45 +00:00
- run:
name: Check PEP 508 Requirements
command: pipenv check
2018-06-21 07:53:19 +00:00
- save_cache:
paths:
- "~/.local/share/virtualenvs/"
2018-07-06 19:21:53 +00:00
key: v2-deps-{{ .Environment.CIRCLE_WORKFLOW_ID }}-{{ checksum "Pipfile.lock" }}-py37
2018-07-06 18:26:27 +00:00
run_tests-35:
<<: *python_35_base
steps:
- checkout
- run:
name: Install dependencies
command: |
pipenv sync --three --dev
pipenv install --dev pytest
2018-07-06 18:26:27 +00:00
- run:
name: pyUmbral Tests (Python 3.5)
command: pipenv run pytest --junitxml=./reports/pytest/python35-results.xml
2018-07-06 18:26:27 +00:00
- store_test_results:
path: /reports/pytest
- store_artifacts:
path: ./htmlcov
2018-06-21 07:53:19 +00:00
run_tests-36:
<<: *python_36_base
2018-06-21 07:53:19 +00:00
steps:
- checkout
- run:
name: Install dependencies
command: pipenv sync --three --dev
2018-06-21 07:53:19 +00:00
- run:
name: pyUmbral Tests (Python 3.6)
command: pipenv run pytest --cov=. --cov-report=html --junitxml=./reports/pytest/python36-results.xml
2018-06-21 07:53:19 +00:00
- store_test_results:
path: /reports/pytest
- store_artifacts:
path: ./htmlcov
2018-06-21 07:53:19 +00:00
2018-07-06 18:26:27 +00:00
run_tests-37:
<<: *python_37_base
2018-06-21 07:53:19 +00:00
steps:
- checkout
- run:
name: Install dependencies
command: pipenv sync --three --dev
2018-06-21 07:53:19 +00:00
- run:
2018-07-06 18:26:27 +00:00
name: pyUmbral Tests (Python 3.7)
command: pipenv run pytest --cov=. --cov-report=html --junitxml=./reports/pytest/python37-results.xml
2018-06-21 07:53:19 +00:00
- store_test_results:
path: /reports/pytest
- store_artifacts:
path: ./htmlcov
2018-06-21 21:26:12 +00:00
2018-07-06 19:21:53 +00:00
mypy_type_check-36:
<<: *python_36_base
steps:
- checkout
- run:
name: Install dependencies
command: pipenv sync --three --dev
- run:
2018-07-09 01:02:32 +00:00
name: Run Mypy Static Type Checks (Always Succeed)
command: |
pipenv install --dev --skip-lock lxml
2018-07-20 21:20:46 +00:00
pipenv run mypy --xslt-html-report ./mypy_report ./umbral --config-file=mypy.ini || true
- store_artifacts:
path: ./mypy_report
2018-06-26 00:46:47 +00:00
doctests-36:
<<: *python_36_base
2018-06-26 00:46:47 +00:00
steps:
- checkout
- run:
name: Install dependencies
command: pipenv sync --three --dev
2018-06-26 00:46:47 +00:00
- run:
name: Run Documentation Tests
command: |
2018-07-06 19:21:53 +00:00
pipenv install -e . --dev --skip-lock
2018-06-26 00:46:47 +00:00
cd docs
pipenv run make doctest
2018-06-26 16:11:48 +00:00
- store_artifacts:
path: ./docs/build/doctest/output.txt
notebook_tests-36:
<<: *python_36_base
steps:
- checkout
- run:
name: Install dependencies
command: pipenv sync --three --dev
- run:
name: Run py.test on Jupyter Notebook stored output
command: |
pipenv install -e . --dev --skip-lock
pipenv run pytest --nbval docs/notebooks/pyUmbral\ Simple\ API.ipynb --junitxml=./reports/pytest/nbval-results.xml
- store_test_results:
path: /reports/pytest
reencryption_memory_profile-36:
<<: *python_36_base
steps:
- checkout
- run:
name: Install dependencies
command: pipenv sync --three --dev
- run:
name: Install Profiling Tools
command: |
sudo apt-get update
sudo apt install -y valgrind
sudo apt install -y massif-visualizer
- run:
name: Profile Re-Encryption Memory Usage
command: |
pipenv run valgrind --tool=massif --massif-out-file=./reencryption_memory_profile.massif.out python3 ./tests/metrics/reencryption_firehose.py
- store_artifacts:
path: ./reencryption_memory_profile.massif.out
reencryption_benchmark-36:
<<: *python_36_base
steps:
- checkout
- run:
name: Install dependencies
command: pipenv sync --three --dev
- run:
name: Benchmark Key Splitting and Reencryption
command: |
2018-07-06 20:21:28 +00:00
pipenv install -e . --dev --skip-lock
pipenv run pytest -v ./tests/metrics/reencryption_benchmark.py --junitxml=./reports/pytest/python36-results.xml --benchmark-verbose --benchmark-autosave --benchmark-histogram=./histograms/histogram
- save_cache:
paths:
- "./.benchmarks"
2018-07-06 19:21:53 +00:00
key: v2-benchmarks-py36-{{ checksum "benchmarks" }}
- store_artifacts:
path: ./histograms
- store_test_results:
path: ./reports/pytest
test_deploy:
<<: *python_36_base
steps:
- checkout
- run:
name: Install Dependencies (Test Deploy)
command: |
pipenv sync --three --dev
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 umbral --verbose
python -c "import umbral; print(umbral.__version__)"
deploy:
2018-08-21 21:32:26 +00:00
<<: *python_36_base
steps:
- checkout
- run:
name: Install dependencies
command: pipenv sync --three --dev
- run:
name: Verify git tag == __version__
command: pipenv run python setup.py verify
- run:
name: Initialize .pypirc
command: |
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 umbral --verbose
python -c "import umbral; print(umbral.__version__)"