generated from BrianLusina/pymaze
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
95 lines (85 loc) · 1.92 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
image: python:3.12
include:
- project: sanctumlabs/tools/ci-workflows
file: .gitlab/templates/slack-notification.yml
stages:
- lint
- test
- build
- publish
variables:
PYTHONDONTWRITEBYTECODE: "1"
PYTHONUNBUFFERED: "1"
POETRY_VIRTUALENVS_IN_PROJECT: "true"
before_script:
- pip install poetry==1.6.1
- poetry install --no-interaction --no-ansi
lint-ruff:
stage: lint
script: make lint-ruff
test:
image: python:${PYTHON_VERSION}
stage: test
needs:
- lint-ruff
services:
- postgres:15-alpine
variables:
DATABASE_URL: "postgresql://sanctumlabs:sanctumlabs@postgres:5432/dbkit-sql"
POSTGRES_DB: "dbkit-sql"
POSTGRES_USER: "sanctumlabs"
POSTGRES_PASSWORD: "sanctumlabs"
DB_HOST: "postgres"
parallel:
matrix:
- PYTHON_VERSION: [ "3.10", "3.11", "3.12" ]
script:
- poetry run coverage run --source='./sanctumlabs_dbkit/' -m pytest -v --junitxml junit-report.xml tests/
- poetry run coverage xml -o coverage.xml
- poetry run coverage xml -o coverage.xml
- poetry run coverage report -m
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
artifacts:
reports:
junit: ./junit-report.xml
coverage_report:
coverage_format: cobertura
path: ./coverage.xml
allow_failure: true
build:
stage: build
needs:
- job: test
parallel:
matrix:
- PYTHON_VERSION: [ "3.10", "3.11", "3.12" ]
script: make build
artifacts:
expire_in: 5 days
when: always
paths:
- dist
allow_failure: true
publish:
stage: publish
script: publish-gitlab
only:
- tags
slack-success:
before_script: [ ]
needs:
- job: lint-ruff
optional: true
- job: test
optional: true
- job: publish
optional: true
slack-failure:
before_script: [ ]
needs:
- job: lint-ruff
optional: true
- job: test
optional: true
- job: publish
optional: true