From 435946f7690fcc922a78ae291b15cee1748b085a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?c=C4=83t=C4=83lin?= Date: Sat, 27 Aug 2022 16:36:39 +0200 Subject: [PATCH] ci: add pytest job --- .drone.yml | 126 ++++++++++++++++++++++++++++------------------------- 1 file changed, 66 insertions(+), 60 deletions(-) diff --git a/.drone.yml b/.drone.yml index e0ef5a7..314320f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -13,67 +13,73 @@ environment: PRE_COMMIT_HOME: /drone/src/.cache/.pre-commit steps: -- name: restore cache - image: meltwater/drone-cache - pull: true - environment: - AWS_ACCESS_KEY_ID: - from_secret: AWS_ACCESS_KEY_ID - AWS_SECRET_ACCESS_KEY: - from_secret: AWS_SECRET_ACCESS_KEY - settings: - restore: true - bucket: halig-cache - endpoint: https://s3.fukurokuju.dev - region: us-east-1 - path_style: true - mount: - - .venv - - .cache/.pre-commit + - name: restore cache + image: meltwater/drone-cache + pull: true + environment: + AWS_ACCESS_KEY_ID: + from_secret: AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY: + from_secret: AWS_SECRET_ACCESS_KEY + settings: + restore: true + bucket: halig-cache + endpoint: https://s3.fukurokuju.dev + region: us-east-1 + path_style: true + mount: + - .venv + - .cache/.pre-commit -- name: install dependencies - pull: true - image: git.roboces.dev/catalin/poetry:beta - commands: - - poetry config virtualenvs.in-project 1 - - poetry install --with linters + - name: install dependencies + pull: true + image: git.roboces.dev/catalin/poetry:beta + commands: + - poetry config virtualenvs.in-project 1 + - poetry install --with linters,test -- name: lint - pull: true - image: git.roboces.dev/catalin/poetry:beta - commands: - - .venv/bin/pre-commit run --all-files --color always + - name: lint + pull: true + image: git.roboces.dev/catalin/poetry:beta + commands: + - .venv/bin/pre-commit run --all-files --color always -- name: deploy - pull: true - image: git.roboces.dev/catalin/poetry:beta - commands: - - poetry build - - 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: tests + pull: true + image: git.roboces.dev/catalin/poetry:beta + commands: + - .venv/bin/pytest -- name: rebuild cache - image: meltwater/drone-cache - pull: true - environment: - AWS_ACCESS_KEY_ID: - from_secret: AWS_ACCESS_KEY_ID - AWS_SECRET_ACCESS_KEY: - from_secret: AWS_SECRET_ACCESS_KEY - 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 + - name: deploy + pull: true + image: git.roboces.dev/catalin/poetry:beta + commands: + - poetry build + - 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 + image: meltwater/drone-cache + pull: true + environment: + AWS_ACCESS_KEY_ID: + from_secret: AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY: + from_secret: AWS_SECRET_ACCESS_KEY + 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