-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
74 lines (68 loc) · 1.45 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
stages:
- build
- test
- package
.pip-install:
before_script:
- pip install --upgrade pip
linter:
extends:
- .pip-install
image: python:3.11
stage: test
script:
- pip install flake8
- flake8 src
- pip install black
- black . --check --verbose --diff --color
static-check:
extends:
- .pip-install
image: python:3.11
stage: test
script:
- pip install mypy
- mypy --install-types --non-interactive src/
- mypy src --config-file=mypy.ini
needs:
- linter
api-tests:
stage: test
image: docker/compose:1.27.4
services:
- docker:dind
variables:
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
DOCKER_BUILDKIT: 1
COMPOSE_DOCKER_CLI_BUILD: 1
before_script:
- mkdir reports
- rm -rf .env
script:
- ./entrypoint.sh CITest
artifacts:
paths:
- reports/flake8/flake8stats.txt
- reports/junit/junit.xml
- reports/coverage/coverage.xml
needs:
- static-check
badges:
image: python:3.11
stage: test
script:
- pip install genbadge
- pip install defusedxml
- genbadge coverage -i reports/coverage/coverage.xml -o coverage-badge.svg
- genbadge flake8 -i reports/flake8/flake8stats.txt -o flake8-badge.svg
- genbadge tests -i reports/junit/junit.xml -o tests-badge.svg
needs:
- api-tests
dependencies:
- api-tests
artifacts:
paths:
- flake8-badge.svg
- tests-badge.svg
- coverage-badge.svg