ci: add pytest job
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
cătălin 2022-08-27 16:36:39 +02:00
commit 435946f769
Signed by: catalin
GPG key ID: 0178DF42F43E5FD2

View file

@ -13,67 +13,73 @@ environment:
PRE_COMMIT_HOME: /drone/src/.cache/.pre-commit PRE_COMMIT_HOME: /drone/src/.cache/.pre-commit
steps: steps:
- name: restore cache - name: restore cache
image: meltwater/drone-cache image: meltwater/drone-cache
pull: true pull: true
environment: environment:
AWS_ACCESS_KEY_ID: AWS_ACCESS_KEY_ID:
from_secret: AWS_ACCESS_KEY_ID from_secret: AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: AWS_SECRET_ACCESS_KEY:
from_secret: AWS_SECRET_ACCESS_KEY from_secret: AWS_SECRET_ACCESS_KEY
settings: settings:
restore: true restore: true
bucket: halig-cache bucket: halig-cache
endpoint: https://s3.fukurokuju.dev endpoint: https://s3.fukurokuju.dev
region: us-east-1 region: us-east-1
path_style: true path_style: true
mount: mount:
- .venv - .venv
- .cache/.pre-commit - .cache/.pre-commit
- name: install dependencies - name: install dependencies
pull: true pull: true
image: git.roboces.dev/catalin/poetry:beta image: git.roboces.dev/catalin/poetry:beta
commands: commands:
- poetry config virtualenvs.in-project 1 - poetry config virtualenvs.in-project 1
- poetry install --with linters - poetry install --with linters,test
- name: lint - name: lint
pull: true pull: true
image: git.roboces.dev/catalin/poetry:beta image: git.roboces.dev/catalin/poetry:beta
commands: commands:
- .venv/bin/pre-commit run --all-files --color always - .venv/bin/pre-commit run --all-files --color always
- name: deploy - name: tests
pull: true pull: true
image: git.roboces.dev/catalin/poetry:beta image: git.roboces.dev/catalin/poetry:beta
commands: commands:
- poetry build - .venv/bin/pytest
- poetry config repositories.roboces https://git.roboces.dev/api/packages/catalin/pypi
- poetry config http-basic.roboces "$REGISTRY_USERNAME" "$REGISTRY_PASSWORD"
- poetry publish --repository roboces
when:
ref:
- refs/tags/v*
- name: rebuild cache - name: deploy
image: meltwater/drone-cache pull: true
pull: true image: git.roboces.dev/catalin/poetry:beta
environment: commands:
AWS_ACCESS_KEY_ID: - poetry build
from_secret: AWS_ACCESS_KEY_ID - poetry config repositories.roboces https://git.roboces.dev/api/packages/catalin/pypi
AWS_SECRET_ACCESS_KEY: - poetry config http-basic.roboces "$REGISTRY_USERNAME" "$REGISTRY_PASSWORD"
from_secret: AWS_SECRET_ACCESS_KEY - poetry publish --repository roboces
settings: when:
rebuild: true ref:
path_style: true - refs/tags/v*
bucket: halig-cache
endpoint: https://s3.fukurokuju.dev - name: rebuild cache
region: us-east-1 image: meltwater/drone-cache
mount: pull: true
- .venv environment:
- .cache/.pre-commit AWS_ACCESS_KEY_ID:
when: from_secret: AWS_ACCESS_KEY_ID
status: AWS_SECRET_ACCESS_KEY:
- failure from_secret: AWS_SECRET_ACCESS_KEY
- success settings:
rebuild: true
path_style: true
bucket: halig-cache
endpoint: https://s3.fukurokuju.dev
region: us-east-1
mount:
- .venv
- .cache/.pre-commit
when:
status:
- failure
- success