forked from scikit-image/scikit-image
-
Notifications
You must be signed in to change notification settings - Fork 0
194 lines (165 loc) · 5.98 KB
/
test-linux.yaml
File metadata and controls
194 lines (165 loc) · 5.98 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: Test Linux
on: [push, pull_request, merge_group]
concurrency:
# Cancel previous workflows of the same PR, but only for PRs
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
permissions:
contents: read
env:
PYTEST: "pytest --config-file ${{ github.workspace }}/pyproject.toml"
jobs:
test_skimage_linux:
name: linux-cp${{ matrix.python-version }}-${{ matrix.OPTIONS_NAME }}
runs-on: ubuntu-latest
strategy:
# Ensure that a wheel builder finishes even if another fails
fail-fast: false
matrix:
python-version: ["3.11", "3.13", "3.14"]
# Dependency options for setup-test-env.sh
MINIMUM_REQUIREMENTS: [0]
OPTIONAL_DEPS: [0]
WITHOUT_POOCH: [0]
PIP_FLAGS: [""]
# Flag that chooses between source and sdist build
INSTALL_FROM_SDIST: [0]
# Flags that control lazy-loader behavior
EAGER_IMPORT: [0]
# Python flags
PYTHONOPTIMIZE: [0]
# Flag to control naming of workflow job
OPTIONS_NAME: ["default"]
include:
- platform_id: manylinux_x86_64
python-version: "3.11"
MINIMUM_REQUIREMENTS: 1
OPTIONAL_DEPS: 0
EAGER_IMPORT: 1
OPTIONS_NAME: "mini-req-eager-import"
- platform_id: manylinux_x86_64
python-version: "3.11"
MINIMUM_REQUIREMENTS: 1
OPTIONAL_DEPS: 1
OPTIONS_NAME: "mini-req-optional-deps"
- platform_id: manylinux_x86_64
python-version: "3.12"
PIP_FLAGS: "--pre"
OPTIONS_NAME: "pre"
- platform_id: manylinux_x86_64
python-version: "3.12"
OPTIONAL_DEPS: 1
OPTIONS_NAME: "optional-deps"
- platform_id: manylinux_x86_64
python-version: "3.12"
PYTHONOPTIMIZE: 2
WITHOUT_POOCH: 1
OPTIONS_NAME: "optimize and no pooch"
- platform_id: manylinux_x86_64
python-version: "3.12"
INSTALL_FROM_SDIST: 1
OPTIONS_NAME: "install-from-sdist"
steps:
- name: Checkout scikit-image
uses: actions/checkout@v5
with:
persist-credentials: false
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version}}
allow-prereleases: true
cache: "pip"
cache-dependency-path: "requirements/*.txt"
- name: Install build dependencies
if: ${{ matrix.INSTALL_FROM_SDIST != 1 }}
env:
PIP_FLAGS: ${{ matrix.PIP_FLAGS }}
run: |
source .github/scripts/setup-build-env.sh
- name: Build and install from source
if: ${{ matrix.INSTALL_FROM_SDIST != 1 }}
run: |
pip install -v --no-build-isolation .
- name: Build and install from sdist
if: ${{ matrix.INSTALL_FROM_SDIST == 1 }}
run: |
pip install build
python -m build --sdist .
pip install dist/scikit_image-*.tar.gz
- name: Install test dependencies
env:
MINIMUM_REQUIREMENTS: ${{ matrix.MINIMUM_REQUIREMENTS }}
OPTIONAL_DEPS: ${{ matrix.OPTIONAL_DEPS }}
WITHOUT_POOCH: ${{ matrix.WITHOUT_POOCH }}
PIP_FLAGS: ${{ matrix.PIP_FLAGS }}
run: |
source .github/scripts/setup-test-env.sh
- name: Verify non-conflicting dependencies
if: ${{ matrix.OPTIONAL_DEPS == 1 && matrix.MINIMUM_REQUIREMENTS == 0}}
run: |
# Attempt to resolve all requirements simultaneously
pip install --dry-run --ignore-installed $(ls requirements/*.txt | sed 's/^/-r /')
- name: Run tests
env:
# A lazy loader configuration parameter
EAGER_IMPORT: ${{ matrix.EAGER_IMPORT }}
run: |
$PYTEST --doctest-plus --showlocals --pyargs skimage ./tests
- name: Check benchmarks
run: |
asv check -v -E existing
test_skimage_linux_free_threaded:
name: linux-cp313t-default
runs-on: ubuntu-latest
steps:
- name: Checkout scikit-image
uses: actions/checkout@v5
with:
persist-credentials: false
# TODO: replace with setup-python when there is support
- uses: deadsnakes/action@e640ac8743173a67cca4d7d77cd837e514bf98e8 # v3.2.0
with:
python-version: "3.13"
nogil: true
- name: Install build dependencies
# See special clause inside setup-build-env.sh that detects when
# free threaded build is used, and then installs dependencies
# from nightly wheels
env:
PIP_FLAGS: "--pre"
run: |
source .github/scripts/setup-build-env.sh
- name: Build and install
run: |
pip install -v --no-build-isolation .
- name: Install test dependencies
# See special clause inside setup-test-env.sh that detects when
# free threaded build is used, and then installs dependencies
# from nightly wheels
env:
PIP_FLAGS: "--pre"
run: |
source .github/scripts/setup-test-env.sh
- name: Run tests
env:
PYTHON_GIL: 0
# A lazy loader configuration parameter
EAGER_IMPORT: ${{ matrix.EAGER_IMPORT }}
run: |
$PYTEST --doctest-plus --showlocals --pyargs skimage ./tests
report-failures:
runs-on: ubuntu-latest
needs: [test_skimage_linux, test_skimage_linux_free_threaded]
if: ${{ always() && github.ref == 'refs/heads/main' && contains(needs.*.result, 'failure') }}
permissions:
issues: write
steps:
- name: "Job has failed: reporting"
uses: JasonEtco/create-an-issue@1b14a70e4d8dc185e5cc76d3bec9eab20257b2c5 # v2.9.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BUILD_TYPE: "linux tests"
with:
filename: .github/MAIN_FAIL_TEMPLATE.md
update_existing: true