Repository navigation
198 lines (157 loc) · 4.47 KB
/
Copy pathci.yaml
File metadata and controls
198 lines (157 loc) · 4.47 KB
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
name: CI
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
tags:
- v*
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Run build action
uses: minvws/action-python-poetry-install@v1
with:
python_version: "3.14"
- name: Check the lock file matches pyproject.toml
run: poetry check --lock
lint:
name: Run code linter
runs-on: ubuntu-24.04
needs: build
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Run build action
uses: minvws/action-python-poetry-install@v1
with:
python_version: "3.14"
- name: Lint
run: make POETRY=true lint
type-check:
name: Check static types
runs-on: ubuntu-24.04
needs: build
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Run build action
uses: minvws/action-python-poetry-install@v1
with:
python_version: "3.14"
- name: Check static types
run: make POETRY=true type-check
safety-check:
name: Scan packages for vulnerabilities
runs-on: ubuntu-24.04
needs: build
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Run build action
uses: minvws/action-python-poetry-install@v1
with:
python_version: "3.14"
- name: Scan packages for vulnerabilities
run: make POETRY=true safety-check
spelling-check:
name: Run spelling check
runs-on: ubuntu-24.04
needs: build
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Run build action
uses: minvws/action-python-poetry-install@v1
with:
python_version: "3.14"
- uses: codespell-project/codespell-problem-matcher@v1
- name: Run spelling check
run: make POETRY=true spelling-check
test:
name: Run the tests (Python ${{ matrix.python_version }})
runs-on: ubuntu-24.04
needs: build
strategy:
fail-fast: false
matrix:
python_version: ["3.11", "3.12", "3.13", "3.14"]
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Run build action
uses: minvws/action-python-poetry-install@v1
with:
python_version: ${{ matrix.python_version }}
- name: Run the tests
run: make POETRY=true test
- name: Upload coverage report
if: matrix.python_version == '3.14'
uses: actions/upload-artifact@v7
with:
name: coverage
path: coverage.xml
install-without-extras:
name: Import without the fastapi extra
runs-on: ubuntu-24.04
needs: build
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: "3.11"
- name: Install the package without extras
run: pip install .
- name: Import the package
run: python -c "import gfmodules.logging"
reuse:
name: Check licensing compliance
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Run REUSE compliance check
uses: fsfe/reuse-action@v6
tag-version:
name: Check the tag matches the package version
runs-on: ubuntu-24.04
if: startsWith(github.ref, 'refs/tags/v')
needs: build
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Compare the tag against pyproject.toml
run: |
tag="${GITHUB_REF_NAME#v}"
version="$(grep -m1 '^version = ' pyproject.toml | cut -d'"' -f2)"
if [ "$tag" != "$version" ]; then
echo "tag $GITHUB_REF_NAME does not match pyproject.toml version $version" >&2
exit 1
fi
sonar:
name: SonarCloud
runs-on: ubuntu-24.04
needs: test
steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Download coverage report
uses: actions/download-artifact@v8
with:
name: coverage
- name: Run SonarQube scan
uses: minvws/action-sonarqube@v1
with:
sonar-token: ${{ secrets.SONAR_TOKEN }}