-
-
Notifications
You must be signed in to change notification settings - Fork 92
194 lines (177 loc) · 7.31 KB
/
Copy pathci_tests.yml
File metadata and controls
194 lines (177 loc) · 7.31 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
name: CI
on:
workflow_dispatch:
push:
pull_request:
schedule:
# run every Monday at 6am UTC
- cron: '0 6 * * 1'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
SETUP_XVFB: True # avoid issues if mpl tries to open a GUI window
TOXARGS: '-v'
jobs:
ci-tests:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
if: "!(contains(github.event.head_commit.message, '[skip ci]') || contains(github.event.head_commit.message, '[ci skip]'))"
strategy:
matrix:
include:
- name: 'ubuntu-py311-oldestdeps'
os: ubuntu-latest
python: '3.11'
# Test the oldest supported dependencies on the oldest supported Python
tox_env: 'py311-test-oldestdeps'
# Do not include bottleneck in this coverage test. By not including
# it we get a better measure of how we are covered when using the
# array API, which bottleneck short-circuits.
- name: 'ubuntu-py312-coverage'
os: ubuntu-latest
python: '3.12'
tox_env: 'py312-test-alldeps-cov'
# Test non-numpy array libraries
- name: 'ubuntu-py313-jax'
os: ubuntu-latest
python: '3.13'
tox_env: 'py313-jax'
# Move bottleneck test a test without coverage
- name: 'ubuntu-py312-bottleneck'
os: ubuntu-latest
python: '3.12'
tox_env: 'py312-test-alldeps-numpy126'
- name: 'macos-py312-dask'
os: macos-latest
python: '3.12'
tox_env: 'py312-alldeps-dask'
# Regression gate: fail if a new array-API "escape" (a silent numpy
# coercion of a dask array in library code) appears that is not in
# the checked-in baseline, ccdproc/tests/array_escape_baseline.txt.
# No bottleneck here (as with the dask job above) so the numpy
# fallback paths are exercised.
- name: 'ubuntu-py312-dask-escape-baseline'
os: ubuntu-latest
python: '3.12'
tox_env: 'py312-alldeps-dask-enforce'
- name: 'windows-py312'
os: windows-latest
python: '3.12'
tox_env: 'py312-test-alldeps'
- name: 'ubuntu-ruff'
os: ubuntu-latest
python: '3.12'
tox_env: 'codestyle'
- name: 'ubuntu-build_docs'
os: ubuntu-latest
python: '3.12'
tox_env: 'build_docs'
- name: 'ubuntu-py313-test-alldeps-devdeps'
os: ubuntu-latest
python: '3.13'
tox_env: 'py313-test-alldeps-devdeps'
steps:
- name: Check out repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
with:
python-version: ${{ matrix.python }}
- name: Install base dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox wheel
- name: Install graphviz dependency
if: "endsWith(matrix.tox_env, 'build_docs')"
run: sudo apt-get -y install graphviz
- name: Print Python env
run: |
python --version
python -m pip list
- name: Run tests
if: "! matrix.use_remote_data"
run: |
tox -e ${{ matrix.tox_env }} -- ${{ matrix.toxposargs }}
# - name: Run tests with remote data
# if: "matrix.use_remote_data"
# run: tox -e ${{ matrix.tox_env }} -- --remote-data=any
- name: Upload coverage to codecov
if: "endsWith(matrix.tox_env, '-cov')"
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
# The strict array-API job is in its own matrix so that its failures --
# expected until the remaining array-API bugs are fixed -- stay visible
# without cancelling the main test matrix above. The test step uses
# continue-on-error so the job (and the PR checks rollup) stays green;
# the real outcome is reported as a warning annotation, in the step
# summary, and via a per-matrix-entry strict-job-outcome-* artifact that
# strict_status.yml turns into a check run on the PR.
ci-tests-expected-failures:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
if: "!(contains(github.event.head_commit.message, '[skip ci]') || contains(github.event.head_commit.message, '[ci skip]'))"
strategy:
matrix:
include:
- name: 'ubuntu-py313-strict'
os: ubuntu-latest
python: '3.13'
tox_env: 'py313-strict'
steps:
- name: Check out repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
with:
python-version: ${{ matrix.python }}
- name: Install base dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox wheel
- name: Print Python env
run: |
python --version
python -m pip list
- name: Run tests
id: tests
continue-on-error: true
run: |
tox -e ${{ matrix.tox_env }} -- ${{ matrix.toxposargs }}
# always() so an outcome file is recorded even when an earlier step
# failed; a skipped/cancelled tests step is recorded as "error" (an
# infrastructure failure) rather than being conflated with an expected
# test failure. The JSON schema here is the contract with
# strict_status.yml: {"name": "<matrix name>", "state": "success" |
# "failure" | "error"}.
- name: Record test outcome
if: always()
run: |
case "${{ steps.tests.outcome }}" in
success) state='success' ;;
failure) state='failure' ;;
*) state='error' ;;
esac
printf '{"name": "%s", "state": "%s"}\n' '${{ matrix.name }}' "$state" > strict-outcome.json
if [ "$state" = "failure" ]; then
echo "::warning::${{ matrix.tox_env }} tests failed (expected until the remaining array-API bugs are fixed)"
echo ":warning: **${{ matrix.name }}**: tests **failed** (expected until the remaining array-API bugs are fixed)" >> "$GITHUB_STEP_SUMMARY"
elif [ "$state" = "success" ]; then
echo ":tada: **${{ matrix.name }}**: tests **passed** -- the expected-failures carve-out for this job can be retired" >> "$GITHUB_STEP_SUMMARY"
else
echo "::warning::${{ matrix.name }} job hit an infrastructure error before the tests step completed (outcome: ${{ steps.tests.outcome }})"
echo ":x: **${{ matrix.name }}**: job hit an **infrastructure error** before the tests step completed (outcome: ${{ steps.tests.outcome }})" >> "$GITHUB_STEP_SUMMARY"
fi
- name: Upload test outcome
if: always()
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # 6.0.0
with:
# Include the matrix entry name so the artifact names stay unique if
# this matrix grows (upload-artifact v4+ errors on duplicate names).
name: strict-job-outcome-${{ matrix.name }}
path: strict-outcome.json