-
Notifications
You must be signed in to change notification settings - Fork 41
197 lines (168 loc) · 6.22 KB
/
test.yaml
File metadata and controls
197 lines (168 loc) · 6.22 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
name: Test
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
schedule:
# Every night at 03:00 UTC
- cron: '0 3 * * *'
permissions:
contents: read
id-token: write
jobs:
wait-on-wheel:
name: Wait for wheel
runs-on: ubuntu-latest
permissions:
checks: read
steps:
- name: Wait on build.yaml to build the wheel
uses: lewagon/wait-on-check-action@v1.3.1
with:
# When triggered on a pull request, github.sha is a temporary merge commit for the PR. The wait
# action must wait on the SHA of the commit that triggered the workflow, which is the HEAD of the
# PR branch. https://github.com/lewagon/wait-on-check-action/issues/25#issuecomment-784773361
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
# NOTE: Fake ternary operator, see https://github.com/actions/runner/issues/409
repo-token: ${{ secrets.GITHUB_TOKEN }}
check-name: 'Wheel'
allowed-conclusions: success
wait-interval: 10
test-coverage:
name: Coverage
needs: wait-on-wheel
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: '3.13'
cache: 'pip'
cache-dependency-path: |
requirements-test.txt
pyproject.toml
- name: Upgrade pip
run: python3 -m pip install --upgrade pip
- name: Download wheel artifact
uses: dawidd6/action-download-artifact@v6
with:
workflow: build.yaml
workflow_conclusion: success
commit: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
# NOTE: Fake ternary operator, see https://github.com/actions/runner/issues/409
allow_forks: true
# This is needed because Windows terminal cannot expand `pip install galois-*.whl`
- name: Get wheel file name
uses: tj-actions/glob@v15
id: glob
with:
files: galois-*.whl
working-directory: dist/
- name: Install the dev dependencies
run: python3 -m pip install -r requirements-test.txt
- name: Install the `galois` package wheel with upgraded dependencies
run: python3 -m pip install --upgrade dist/${{ steps.glob.outputs.paths }}
- name: Test with pytest
run: python3 -m pytest -n auto --cov=galois --cov-report=xml tests/
- name: Upload coverage report
uses: codecov/codecov-action@v5
with:
use_oidc: true
fail_ci_if_error: false
verbose: true
test-min:
name: Min
needs: wait-on-wheel
if: ${{ github.event_name == 'pull_request' }}
strategy:
matrix:
os: [ubuntu-22.04, windows-2022]
# Old Numba versions only have binaries for Linux and Windows
python-version: [3.7, 3.8, 3.9, '3.10', 3.11, 3.12, 3.13, 3.14]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: |
requirements-min.txt
requirements-test.txt
pyproject.toml
- name: Upgrade pip
run: python3 -m pip install --upgrade pip
- name: Download wheel artifact
uses: dawidd6/action-download-artifact@v6
with:
workflow: build.yaml
workflow_conclusion: success
commit: ${{github.event.pull_request.head.sha}}
allow_forks: true
# This is needed because Windows terminal cannot expand `pip install galois-*.whl`
- name: Get wheel file name
uses: tj-actions/glob@v15
id: glob
with:
files: galois-*.whl
working-directory: dist/
- name: Install minimum package dependencies
run: python3 -m pip install -r requirements-min.txt
- name: Install the dev dependencies
run: python3 -m pip install -r requirements-test.txt
- name: Install the `galois` package wheel
run: python3 -m pip install dist/${{ steps.glob.outputs.paths }}
- name: Test with pytest
run: python3 -m pytest -n auto tests/
test-latest:
name: Latest
needs: wait-on-wheel
if: ${{ github.event_name == 'pull_request' }}
strategy:
matrix:
os: [ubuntu-22.04, macos-14, windows-2022]
python-version: [3.7, 3.8, 3.9, '3.10', 3.11, 3.12, 3.13, 3.14]
# https://github.com/actions/runner-images/issues/9770#issuecomment-2085623315
exclude: # Python < v3.9 not supported on Apple Silicon ARM64 (MacOS 14)
- python-version: "3.7"
os: macos-14
- python-version: "3.8"
os: macos-14
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: |
requirements-test.txt
pyproject.toml
- name: Upgrade pip
run: python3 -m pip install --upgrade pip
- name: Download wheel artifact
uses: dawidd6/action-download-artifact@v6
with:
workflow: build.yaml
workflow_conclusion: success
commit: ${{github.event.pull_request.head.sha}}
allow_forks: true
# This is needed because Windows terminal cannot expand `pip install galois-*.whl`
- name: Get wheel file name
uses: tj-actions/glob@v15
id: glob
with:
files: galois-*.whl
working-directory: dist/
- name: Install the dev dependencies
run: python3 -m pip install -r requirements-test.txt
- name: Install the `galois` package wheel with upgraded dependencies
run: python3 -m pip install --upgrade dist/${{ steps.glob.outputs.paths }}
- name: Test with pytest
run: python3 -m pytest -n auto tests/