mirror of https://github.com/nucypher/pyUmbral.git
376 lines
11 KiB
YAML
376 lines
11 KiB
YAML
version: 2.0
|
|
|
|
workflows:
|
|
version: 2
|
|
build_test_deploy:
|
|
jobs:
|
|
- pipenv_install_35:
|
|
filters:
|
|
tags:
|
|
only: /.*/
|
|
- pipenv_install_36:
|
|
filters:
|
|
tags:
|
|
only: /.*/
|
|
- pipenv_install_37:
|
|
filters:
|
|
tags:
|
|
only: /.*/
|
|
- run_tests_35:
|
|
filters:
|
|
tags:
|
|
only: /.*/
|
|
requires:
|
|
- pipenv_install_35
|
|
- run_tests_36:
|
|
filters:
|
|
tags:
|
|
only: /.*/
|
|
requires:
|
|
- pipenv_install_36
|
|
- run_tests_37:
|
|
filters:
|
|
tags:
|
|
only: /.*/
|
|
requires:
|
|
- pipenv_install_37
|
|
- mypy_type_check_36:
|
|
filters:
|
|
tags:
|
|
only: /.*/
|
|
requires:
|
|
- run_tests_35
|
|
- run_tests_36
|
|
- run_tests_37
|
|
- doctests_36:
|
|
filters:
|
|
tags:
|
|
only: /.*/
|
|
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
|
|
- reencryption_memory_profile_36:
|
|
filters:
|
|
tags:
|
|
only: /.*/
|
|
requires:
|
|
- run_tests_35
|
|
- run_tests_36
|
|
- run_tests_37
|
|
- reencryption_benchmark_36:
|
|
filters:
|
|
tags:
|
|
only: /.*/
|
|
requires:
|
|
- run_tests_35
|
|
- run_tests_36
|
|
- run_tests_37
|
|
- test_deploy:
|
|
context: "NuCypher PyPI"
|
|
requires:
|
|
- mypy_type_check_36
|
|
- doctests_36
|
|
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: /.*/
|
|
|
|
python_35_base: &python_35_base
|
|
working_directory: ~/pyUmbral_35
|
|
docker:
|
|
- image: circleci/python:3.5
|
|
|
|
python_36_base: &python_36_base
|
|
working_directory: ~/pyUmbral_36
|
|
docker:
|
|
- image: circleci/python:3.6
|
|
|
|
python_37_base: &python_37_base
|
|
working_directory: ~/pyUmbral_37
|
|
docker:
|
|
- image: circleci/python:3.7
|
|
|
|
jobs:
|
|
|
|
pipenv_install_35:
|
|
<<: *python_35_base
|
|
steps:
|
|
- checkout
|
|
- run:
|
|
name: Install Python dependencies with Pipenv
|
|
command: pipenv sync --three --dev
|
|
- run:
|
|
name: Check PEP 508 Requirements
|
|
command: pipenv check
|
|
- save_cache:
|
|
paths:
|
|
- "~/.local/share/virtualenvs/"
|
|
key: v2-deps-{{ .Environment.CIRCLE_WORKFLOW_ID }}-{{ checksum "Pipfile.lock" }}-py35
|
|
|
|
pipenv_install_36:
|
|
<<: *python_36_base
|
|
steps:
|
|
- checkout
|
|
- run:
|
|
name: Install Python dependencies with Pipenv
|
|
command: pipenv sync --three --dev
|
|
- run:
|
|
name: Check PEP 508 Requirements
|
|
command: pipenv check
|
|
- save_cache:
|
|
paths:
|
|
- "~/.local/share/virtualenvs/"
|
|
key: v2-deps-{{ .Environment.CIRCLE_WORKFLOW_ID }}-{{ checksum "Pipfile.lock" }}-py36
|
|
|
|
pipenv_install_37:
|
|
<<: *python_37_base
|
|
steps:
|
|
- checkout
|
|
- run:
|
|
name: Install Python dependencies with Pipenv
|
|
command: pipenv sync --three --dev
|
|
- run:
|
|
name: Check PEP 508 Requirements
|
|
command: pipenv check
|
|
- save_cache:
|
|
paths:
|
|
- "~/.local/share/virtualenvs/"
|
|
key: v2-deps-{{ .Environment.CIRCLE_WORKFLOW_ID }}-{{ checksum "Pipfile.lock" }}-py37
|
|
|
|
run_tests_35:
|
|
<<: *python_35_base
|
|
steps:
|
|
- checkout
|
|
- run:
|
|
name: Install dependencies
|
|
command: |
|
|
pipenv sync --three --dev
|
|
pipenv install --dev pytest
|
|
- run:
|
|
name: pyUmbral Tests (Python 3.5)
|
|
command: pipenv run pytest --cov=. --cov-report=html --junitxml=./reports/pytest/python35-results.xml
|
|
- store_test_results:
|
|
path: /reports/pytest
|
|
- store_artifacts:
|
|
path: ./htmlcov
|
|
|
|
run_tests_36:
|
|
<<: *python_36_base
|
|
steps:
|
|
- checkout
|
|
- run:
|
|
name: Install dependencies
|
|
command: pipenv sync --three --dev
|
|
- run:
|
|
name: pyUmbral Tests (Python 3.6)
|
|
command: pipenv run pytest --cov=. --cov-report=html --junitxml=./reports/pytest/python36-results.xml
|
|
- store_test_results:
|
|
path: /reports/pytest
|
|
- store_artifacts:
|
|
path: ./htmlcov
|
|
|
|
run_tests_37:
|
|
<<: *python_37_base
|
|
steps:
|
|
- checkout
|
|
- run:
|
|
name: Install dependencies
|
|
command: pipenv sync --three --dev
|
|
- run:
|
|
name: pyUmbral Tests (Python 3.7)
|
|
command: pipenv run pytest --cov=. --cov-report=html --junitxml=./reports/pytest/python37-results.xml
|
|
- store_test_results:
|
|
path: /reports/pytest
|
|
- store_artifacts:
|
|
path: ./htmlcov
|
|
|
|
|
|
mypy_type_check_36:
|
|
<<: *python_36_base
|
|
steps:
|
|
- checkout
|
|
- run:
|
|
name: Install dependencies
|
|
command: pipenv sync --three --dev
|
|
- run:
|
|
name: Run Mypy Static Type Checks
|
|
command: |
|
|
pipenv install --dev --skip-lock lxml
|
|
pipenv run mypy --xslt-html-report ./mypy_report ./umbral --config-file=mypy.ini
|
|
- store_artifacts:
|
|
path: ./mypy_report
|
|
|
|
doctests_36:
|
|
<<: *python_36_base
|
|
steps:
|
|
- checkout
|
|
- run:
|
|
name: Install dependencies
|
|
command: pipenv sync --three --dev
|
|
- run:
|
|
name: Run Documentation Tests
|
|
command: |
|
|
pipenv install -e . --dev --skip-lock
|
|
cd docs
|
|
pipenv run make doctest
|
|
- 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: |
|
|
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"
|
|
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:
|
|
<<: *python_36_base
|
|
steps:
|
|
- checkout
|
|
- run:
|
|
name: Install dependencies
|
|
command: |
|
|
pipenv sync --three --dev
|
|
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 umbral --verbose
|
|
python -c "import umbral; print(umbral.__version__)"
|