Add test pipeline step and a basic test

This commit is contained in:
Deko
2023-03-04 00:15:19 +01:00
parent c8df3b31da
commit 33fd4fa682
12 changed files with 238 additions and 11 deletions

View File

@@ -1,5 +1,6 @@
stages:
- lint
- test
- build
- deploy
@@ -11,17 +12,24 @@ stages:
.base:
image: python:3.11.2
only:
changes:
- "/poetry.lock"
- "/pyproject.toml"
- "/app/*"
.test:
extends: .base
stage: test
before_script:
- *install-deps
.lint:
extends: .base
stage: lint
before_script:
- *install-deps
only:
changes:
- "/poetry.lock"
- "/pyproject.toml"
- "/app/*"
######################################
# #
# LINT STEPS #
@@ -38,6 +46,18 @@ isort:
script:
- poetry run isort --check .
######################################
# #
# TEST STEPS #
# #
######################################
test:
extends: .test
coverage: '/TOTAL.*\s+(\d+\%)/'
script:
- poetry run pytest --cov -v
######################################
# #
# BUILD STEPS #