-
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.
- Loading branch information
1 parent
1fb6952
commit ea6e8ff
Showing
1 changed file
with
91 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,91 @@ | ||
--- | ||
default: | ||
image: docker-registry.eccenca.com/eccenca-python:v3.11.4 | ||
# all jobs can be interrupted in case a new commit is pushed | ||
interruptible: true | ||
before_script: | ||
# make sure poetry creates virtual environment as .venv | ||
- poetry config virtualenvs.in-project true | ||
cache: | ||
# cache the virtual environment based on the poetry lock file | ||
key: | ||
files: | ||
- poetry.lock | ||
paths: | ||
- .venv | ||
|
||
stages: | ||
- test | ||
- build | ||
- publish | ||
|
||
ruff: | ||
stage: test | ||
script: | ||
- task check:ruff | ||
artifacts: | ||
when: always | ||
reports: | ||
junit: | ||
- dist/junit-ruff.xml | ||
|
||
mypy: | ||
stage: test | ||
script: | ||
- task check:mypy | ||
artifacts: | ||
when: always | ||
reports: | ||
junit: | ||
- dist/junit-mypy.xml | ||
|
||
pytest: | ||
stage: test | ||
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/' | ||
script: | ||
- task check:pytest | ||
artifacts: | ||
when: always | ||
reports: | ||
coverage_report: | ||
coverage_format: cobertura | ||
path: dist/coverage.xml | ||
junit: | ||
- dist/junit-pytest.xml | ||
paths: | ||
- dist/badge-coverage.svg | ||
- dist/badge-tests.svg | ||
- dist/coverage | ||
- dist/coverage.xml | ||
|
||
safety: | ||
stage: test | ||
script: | ||
- task check:safety | ||
|
||
build: | ||
stage: build | ||
needs: | ||
- mypy | ||
- pytest | ||
- safety | ||
script: | ||
- task build | ||
artifacts: | ||
when: always | ||
paths: | ||
- dist/*.tar.gz | ||
- dist/*.whl | ||
|
||
pypi: | ||
# publishing only available on a tag | ||
stage: publish | ||
needs: | ||
- ruff | ||
- build | ||
allow_failure: true | ||
when: manual | ||
script: | ||
- poetry config pypi-token.pypi $PYPI_TOKEN | ||
- poetry publish | ||
|