-
-
Notifications
You must be signed in to change notification settings - Fork 53
216 lines (186 loc) · 6.25 KB
/
test.yaml
File metadata and controls
216 lines (186 loc) · 6.25 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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
name: Unit Test
on: [push]
permissions:
contents: read
jobs:
test:
name: Test
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
python: ["python2.7", "python3.3", "python3.4", "python3.5", "python3.6", "python3.7", "python3.8", "python3.9", "python3.10", "python3.11", "python3.12", "python3.13", "python3.14", "pypy", "pypy3"]
steps:
- name: Checkout
uses: actions/checkout@v4.2.2
with:
fetch-depth: 1
show-progress: false
persist-credentials: false
- name: Set version statically
run: |
VERSION=0.0.0
sed -i "s/setup_requires=.*/version='$VERSION',/; s/use_scm_version=.*//" setup.py
- name: Run tests
uses: ./.github/actions/run-in-container
with:
image: danielflook/python-minifier-build:${{ matrix.python }}-2025-09-26
run: |
tox -r -e $(echo "${{ matrix.python }}" | tr -d .)
- name: Upload coverage
if: ${{ matrix.python != 'python3.3' && matrix.python != 'python3.4' }}
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.python }}
path: .coverage.*
include-hidden-files: true
test-windows:
name: Test Windows
runs-on: windows-2025
strategy:
fail-fast: false
matrix:
python-version: ['2.7', '3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
steps:
- name: Checkout
uses: actions/checkout@v4.2.2
with:
fetch-depth: 1
show-progress: false
persist-credentials: false
- name: Set up Python
if: ${{ matrix.python-version != '2.7' && matrix.python-version != '3.14' }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Set up Python 3.14
if: ${{ matrix.python-version == '3.14' }}
uses: actions/setup-python@v5
with:
python-version: '3.14.0-rc.3'
- name: Set up Python
if: ${{ matrix.python-version == '2.7' }}
uses: LizardByte/actions/actions/setup_python@eddc8fc8b27048e25040e37e3585bd3ef9a968ed # master
with:
python-version: ${{ matrix.python-version }}
- name: Set version statically
shell: powershell
run: |
$content = Get-Content setup.py
$content = $content -replace "setup_requires=.*", "version='0.0.0',"
$content = $content -replace "use_scm_version=.*", ""
Set-Content setup.py $content
- name: Install tox
run: |
python -m pip install --upgrade pip
pip install tox
- name: Run tests
run: |
tox -c tox-windows.ini -r -e ${{ matrix.python-version }}
lint:
runs-on: ubuntu-24.04
name: Linting
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
show-progress: false
persist-credentials: false
- name: Lint Actions workflows
run: |
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
./actionlint
- name: Install the latest version of uv
uses: astral-sh/setup-uv@f94ec6bedd8674c4426838e6b50417d36b6ab231 # v5.3.1
- name: Actions Security Check
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
uvx zizmor --format plain .
- name: Lint CHANGELOG
uses: DavidAnson/markdownlint-cli2-action@992badcdf24e3b8eb7e87ff9287fe931bcb00c6e # v20.0.0
with:
config: '.config/changelog.markdownlint.yaml'
globs: 'CHANGELOG.md'
- name: Lint Other Markdown
uses: DavidAnson/markdownlint-cli2-action@992badcdf24e3b8eb7e87ff9287fe931bcb00c6e # v20.0.0
with:
config: '.config/.markdownlint.yaml'
globs: |
**/README.md
- name: Lint Python code
uses: astral-sh/ruff-action@57714a7c8a2e59f32539362ba31877a1957dded1 # v3.5.1
with:
args: --config=.config/ruff.toml check
lint_dockerfiles:
runs-on: ubuntu-24.04
name: Lint Dockerfiles
strategy:
fail-fast: false
matrix:
dockerfile:
- Dockerfile-fedora28
- Dockerfile-fedora30
- Dockerfile-fedora32
- Dockerfile-fedora34
- Dockerfile-fedora36
- Dockerfile-fedora38
- Dockerfile-fedora40
- Dockerfile-fedora42
- Dockerfile-fuzz
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
show-progress: false
persist-credentials: false
- name: Lint ${{ matrix.dockerfile }}
uses: hadolint/hadolint-action@54c9adbab1582c2ef04b2016b760714a4bfde3cf # v3.1.0
with:
dockerfile: ./docker/${{ matrix.dockerfile }}
config: .config/hadolint.yaml
coverage-report:
name: Coverage Report
runs-on: ubuntu-24.04
needs: test
steps:
- name: Checkout
uses: actions/checkout@v4.2.2
with:
fetch-depth: 1
show-progress: false
persist-credentials: false
- name: Download coverage artifacts
uses: actions/download-artifact@v4
with:
pattern: coverage-*
merge-multiple: true
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.14'
- name: Install coverage
run: pip install coverage
- name: Combine coverage
run: |
ls -la .coverage*
coverage combine --rcfile=.config/.coveragerc
ls -la .coverage*
- name: Upload combined coverage
uses: actions/upload-artifact@v4
with:
name: coverage-combined
path: .coverage
include-hidden-files: true
- name: Generate report
run: |
coverage report --rcfile=.config/.coveragerc --format=markdown 2>&1 | tee coverage-report.md
cat coverage-report.md >> "$GITHUB_STEP_SUMMARY"
coverage html --rcfile=.config/.coveragerc
- name: Upload HTML report
uses: actions/upload-artifact@v4
with:
name: coverage-html-report
path: htmlcov/