-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #113 from sigma-epsilon/test
updated config
- Loading branch information
Showing
15 changed files
with
9,690 additions
and
208 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,145 +1,117 @@ | ||
# Python CircleCI 2.1 configuration file | ||
version: 2.1 | ||
|
||
orbs: | ||
# The python orb contains a set of prepackaged circleci configuration you can use repeatedly in your configurations files | ||
# Orb commands and jobs help you with common scripting around a language/tool | ||
# so you dont have to copy and paste it everywhere. | ||
# See the orb documentation here: https://circleci.com/developer/orbs/orb/circleci/python | ||
python: circleci/python@2.1.1 | ||
codecov: codecov/codecov@3.3.0 | ||
|
||
jobs: | ||
build_test: | ||
executors: | ||
my-executor: | ||
docker: | ||
- image: cimg/python:3.10 | ||
|
||
jobs: | ||
run_tests_3_10: | ||
executor: my-executor | ||
steps: | ||
- checkout # checkout source code to working directory | ||
- python/install-packages: | ||
pkg-manager: pip | ||
pip-dependency-file: requirements-test.txt | ||
- run: | ||
command: pip install pytest pytest-cov | ||
- run: | ||
name: Build wheel | ||
command: | | ||
pip install wheel twine | ||
pip install ".[test, dev]" | ||
pip install 'build<0.10.0' | ||
python -m build | ||
- checkout | ||
- run: | ||
name: Refresh packages | ||
command: sudo apt-get update | ||
- run: | ||
name: Install xvfb for offline rendering | ||
command: sudo apt-get install libgl1-mesa-glx xvfb | ||
- python/install-packages: | ||
pkg-manager: poetry | ||
- run: | ||
name: Run tests | ||
# This assumes pytest is installed via the install-package step above | ||
command: python -m pytest | ||
|
||
test_pypi_publish: | ||
docker: | ||
- image: cimg/python:3.10 | ||
steps: | ||
- checkout # checkout source code to working directory | ||
name: Install project | ||
command: | | ||
poetry install --with test | ||
- run: | ||
name: Deploy to testpypi | ||
name: Run tests and generate coverage report | ||
command: | | ||
pip install wheel twine | ||
pip install . | ||
pip install 'build<0.10.0' | ||
python -m build | ||
python -m twine upload --repository testpypi --skip-existing dist/* | ||
pypi_publish: | ||
docker: | ||
- image: cimg/python:3.10 | ||
steps: | ||
- checkout # checkout source code to working directory | ||
chmod +x ./run_tests_with_coverage.sh | ||
./run_tests_with_coverage.sh | ||
- run: | ||
name: Deploy to pypi | ||
name: Upload coverage reports to Codecov | ||
command: | | ||
pip install wheel twine | ||
pip install . | ||
pip install 'build<0.10.0' | ||
python -m build | ||
python -m twine upload --skip-existing dist/* | ||
curl -Os https://uploader.codecov.io/latest/linux/codecov | ||
chmod +x codecov | ||
./codecov -t ${CODECOV_TOKEN} | ||
- store_artifacts: | ||
name: Store coverage report as artifact | ||
path: htmlcov | ||
- store_test_results: | ||
name: Store test results | ||
path: test-results | ||
|
||
test-cov-py310: # This is the name of the job, feel free to change it to better match what you're trying to do! | ||
# These next lines defines a docker executors: https://circleci.com/docs/2.0/executor-types/ | ||
# You can specify an image from dockerhub or use one of the convenience images from CircleCI's Developer Hub | ||
# A list of available CircleCI docker convenience images are available here: https://circleci.com/developer/images/image/cimg/python | ||
# The executor is the environment in which the steps below will be executed - below will use a python 3.9 container | ||
# Change the version below to your required version of python | ||
docker: | ||
- image: cimg/python:3.10 | ||
# Checkout the code as the first step. This is a dedicated CircleCI step. | ||
# The python orb's install-packages step will install the dependencies from a Pipfile via Pipenv by default. | ||
# Here we're making sure we use just use the system-wide pip. By default it uses the project root's requirements.txt. | ||
# Then run your tests! | ||
# CircleCI will report the results back to your VCS provider. | ||
|
||
deploy_to_test_pypi: | ||
executor: my-executor | ||
steps: | ||
- checkout | ||
- python/install-packages: | ||
pkg-manager: poetry | ||
- run: | ||
name: Install package for testing | ||
command: pip install ".[test, dev]" | ||
- run: | ||
name: Refresh packages | ||
command: sudo apt-get update | ||
name: Add new command | ||
command: chmod +x ./export_requirements.sh | ||
- run: | ||
name: Install xvfb for offline rendering | ||
command: sudo apt-get install libgl1-mesa-glx xvfb | ||
name: Build project | ||
command: | | ||
poetry check | ||
poetry lock | ||
./export_requirements.sh | ||
poetry install | ||
poetry build | ||
- run: | ||
name: Run tests and generate coverage report | ||
name: Deploy to TestPyPI | ||
command: | | ||
chmod +x ./run_pytest_cov.sh | ||
./run_pytest_cov.sh | ||
poetry config repositories.testpypi https://test.pypi.org/legacy/ | ||
poetry config pypi-token.testpypi $TEST_PYPI_TOKEN | ||
poetry publish -r testpypi --skip-existing | ||
deploy_to_pypi: | ||
executor: my-executor | ||
steps: | ||
- checkout | ||
- python/install-packages: | ||
pkg-manager: poetry | ||
- run: | ||
name: List working directory contents | ||
command: ls -al | ||
name: Add new command | ||
command: chmod +x ./export_requirements.sh | ||
- run: | ||
name: List home directory contents | ||
command: ls -a ~ | ||
- codecov/upload | ||
- store_artifacts: | ||
name: Store coverage report as artifact | ||
path: htmlcov | ||
- store_test_results: | ||
name: Store test results | ||
path: test-results | ||
name: Build project | ||
command: | | ||
poetry check | ||
poetry lock | ||
./export_requirements.sh | ||
poetry install | ||
poetry build | ||
- run: | ||
name: Deploy to PyPI | ||
command: | | ||
poetry config pypi-token.pypi $PYPI_TOKEN | ||
poetry publish --skip-existing | ||
workflows: | ||
|
||
testing-and-coverage: # This is the name of the workflow, feel free to change it to better match your workflow. | ||
# Inside the workflow, you define the jobs you want to run. | ||
# For more details on extending your workflow, see the configuration docs: https://circleci.com/docs/2.0/configuration-reference/#workflows | ||
test_and_deploy: | ||
jobs: | ||
- test-cov-py310 | ||
- run_tests_3_10 | ||
|
||
build_test_publish: | ||
jobs: | ||
- build_test: | ||
filters: | ||
branches: | ||
only: | ||
- main | ||
- test_pypi_publish: | ||
- deploy_to_test_pypi: | ||
context: | ||
- TestPyPI deploy | ||
requires: | ||
- build_test | ||
- run_tests_3_10 | ||
filters: | ||
branches: | ||
only: | ||
- main | ||
- pypi_publish: | ||
- test | ||
|
||
- deploy_to_pypi: | ||
context: | ||
- PyPI deploy | ||
requires: | ||
- test_pypi_publish | ||
- run_tests_3_10 | ||
filters: | ||
branches: | ||
only: | ||
- main | ||
|
Oops, something went wrong.