Skip to content

Commit 99f356b

Browse files
committed
ci: simplify test workflow (#2869)
* ci: simplify test workflow * ci: try exporting ForthError * ci: use macos11 for now * ci: rename General to Test * ci: fix wheelhouse path * ci: better parameterisation * ci: try cross-platform * ci: use glob action * ci: fix ROOT workflow * ci: fix defaults * ci: fixes * ci: fixes * fix: remaining paths
1 parent accbce3 commit 99f356b

File tree

5 files changed

+42
-176
lines changed

5 files changed

+42
-176
lines changed

.github/workflows/coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
run: python -m pip list
7474

7575
- name: Install test requirements
76-
run: python -m pip install -v -r requirements-test.txt
76+
run: python -m pip install -v -r requirements-test-full.txt
7777

7878
- name: Test
7979
run: >-

.github/workflows/test.yml

Lines changed: 37 additions & 172 deletions
Original file line numberDiff line numberDiff line change
@@ -29,27 +29,38 @@ env:
2929
SOURCE_DATE_EPOCH: "1668811211"
3030

3131
jobs:
32-
Windows:
32+
run-tests:
33+
name: Run Tests
3334
strategy:
3435
matrix:
36+
runs-on:
37+
- windows-latest
38+
- ubuntu-latest
39+
- macos-11
3540
python-version:
3641
- '3.12'
3742
- '3.11'
3843
- '3.10'
3944
- '3.9'
4045
- '3.8'
41-
4246
python-architecture:
4347
- x64
44-
48+
dependencies-kind:
49+
- full
4550
include:
4651
- python-version: '3.9'
4752
python-architecture: x86
53+
runs-on: windows-latest
54+
dependencies-kind: full
55+
- python-version: '3.8'
56+
python-architecture: x64
57+
runs-on: ubuntu-latest
58+
dependencies-kind: minimal
4859

49-
runs-on: windows-2019
60+
runs-on: ${{ matrix.runs-on }}
5061

5162
env:
52-
PIP_ONLY_BINARY: cmake,numpy,pandas
63+
PIP_ONLY_BINARY: numpy,pandas,pyarrow,numexpr,numexpr
5364
PIP_PRE: "1"
5465

5566
steps:
@@ -72,177 +83,32 @@ jobs:
7283
uses: actions/cache@v3
7384
with:
7485
path: awkward-cpp/dist
75-
key: ${{ github.job }}-${{ matrix.python-version }}-${{ matrix.python-architecture }}-${{ hashFiles('awkward-cpp/**') }}
86+
key: ${{ github.job }}-${{ matrix.runs-on }}-${{ matrix.python-version }}-${{ matrix.python-architecture }}-${{ hashFiles('awkward-cpp/**') }}
7687

7788
- name: Build awkward-cpp wheel
7889
if: steps.cache-awkward-cpp-wheel.outputs.cache-hit != 'true'
7990
run: |
8091
python -m pip install build
8192
python -m build -w awkward-cpp
8293
83-
- name: Install awkward, awkward-cpp, and dependencies
84-
run: >-
85-
python -m pip install --only-binary "numpy,pandas,pyarrow,numexpr,numexpr"
86-
-v . @(get-childitem -path awkward-cpp/dist/*.whl)
87-
pytest-github-actions-annotate-failures
88-
-r requirements-test.txt
89-
90-
- name: Print versions
91-
run: python -m pip list
92-
93-
- name: Test specification
94-
if: steps.cache-awkward-cpp-wheel.outputs.cache-hit != 'true'
95-
run: python -m pytest -vv -rs awkward-cpp/tests-spec
96-
97-
- name: Test specification with explicitly defined values
98-
if: steps.cache-awkward-cpp-wheel.outputs.cache-hit != 'true'
99-
run: python -m pytest -vv -rs awkward-cpp/tests-spec-explicit
100-
101-
- name: Test CPU kernels
102-
if: steps.cache-awkward-cpp-wheel.outputs.cache-hit != 'true'
103-
run: python -m pytest -vv -rs awkward-cpp/tests-cpu-kernels
104-
105-
- name: Test
106-
run: python -m pytest -vv -rs tests
107-
108-
MacOS:
109-
strategy:
110-
matrix:
111-
python-version:
112-
- '3.12'
113-
- '3.11'
114-
- '3.10'
115-
- '3.9'
116-
- '3.8'
117-
118-
runs-on: macos-11
119-
120-
env:
121-
PIP_ONLY_BINARY: cmake,numpy
122-
PIP_PRE: "1"
123-
124-
steps:
125-
- uses: actions/checkout@v4
126-
with:
127-
submodules: true
128-
129-
- name: 'Python ${{ matrix.python-version }}'
130-
uses: actions/setup-python@v5
131-
with:
132-
python-version: '${{ matrix.python-version }}'
133-
allow-prereleases: true
134-
135-
- name: Debug wheel tags
136-
run: python -m pip debug --verbose
137-
138-
- name: Generate build files
139-
run: pipx run nox -s prepare -- --headers --signatures --tests
140-
141-
- name: Cache awkward-cpp wheel
142-
id: cache-awkward-cpp-wheel
143-
uses: actions/cache@v3
144-
with:
145-
path: ./awkward-cpp/dist
146-
key: ${{ github.job }}-${{ matrix.python-version }}-${{ hashFiles('awkward-cpp/**') }}
147-
148-
- name: Build awkward-cpp wheel
149-
if: steps.cache-awkward-cpp-wheel.outputs.cache-hit != 'true'
150-
run: |
151-
python -m pip install build
152-
python -m build -w ./awkward-cpp
153-
154-
- name: Install awkward, awkward-cpp, dask-awkward, and dependencies
155-
run: >-
156-
python -m pip install --only-binary "numpy,pandas,pyarrow,numexpr"
157-
-v . ./awkward-cpp/dist/*.whl
158-
pytest-github-actions-annotate-failures
159-
dask-awkward
160-
-r requirements-test.txt
161-
162-
- name: Print versions
163-
run: python -m pip list
164-
165-
- name: Test specification
166-
if: steps.cache-awkward-cpp-wheel.outputs.cache-hit != 'true'
167-
run: python -m pytest -vv -rs awkward-cpp/tests-spec
168-
169-
- name: Test specification with explicitly defined values
170-
if: steps.cache-awkward-cpp-wheel.outputs.cache-hit != 'true'
171-
run: python -m pytest -vv -rs awkward-cpp/tests-spec-explicit
172-
173-
- name: Test CPU kernels
174-
if: steps.cache-awkward-cpp-wheel.outputs.cache-hit != 'true'
175-
run: python -m pytest -vv -rs awkward-cpp/tests-cpu-kernels
176-
177-
- name: Test
178-
run: python -m pytest -vv -rs tests
179-
180-
Linux:
181-
strategy:
182-
matrix:
183-
python-version:
184-
- '3.12'
185-
- '3.11'
186-
- '3.10'
187-
- '3.9'
188-
- '3.8'
189-
extra-pip-constraints:
190-
- "-r requirements-test.txt"
191-
include:
192-
# Lower bounds
193-
- python-version: '3.8'
194-
extra-pip-constraints: "-r requirements-test-minimal.txt"
195-
196-
runs-on: ubuntu-22.04
197-
198-
env:
199-
PIP_ONLY_BINARY: cmake
200-
201-
steps:
202-
- uses: actions/checkout@v4
203-
with:
204-
submodules: true
205-
206-
- name: 'Python ${{ matrix.python-version }}'
207-
uses: actions/setup-python@v5
208-
with:
209-
python-version: '${{ matrix.python-version }}'
210-
allow-prereleases: true
211-
212-
- name: Oldest supported CMake
213-
uses: jwlawson/[email protected]
214-
with:
215-
cmake-version: '3.15.x'
216-
217-
- name: Generate build files
218-
run: pipx run nox -s prepare -- --headers --signatures --tests
219-
220-
- name: Cache awkward-cpp wheel
221-
id: cache-awkward-cpp-wheel
222-
uses: actions/cache@v3
94+
- name: Find built wheel
95+
uses: tj-actions/glob@v17
96+
id: find-wheel
22397
with:
224-
path: ./awkward-cpp/dist
225-
key: ${{ github.job }}-${{ matrix.python-version }}-cmake315-${{ hashFiles('awkward-cpp/**') }}
226-
227-
- name: Build awkward-cpp wheel
228-
if: steps.cache-awkward-cpp-wheel.outputs.cache-hit != 'true'
229-
run: |
230-
python -m pip install build
231-
python -m build -w ./awkward-cpp
98+
files: |
99+
awkward-cpp/dist/*.whl
232100
233101
- name: Install awkward, awkward-cpp, and dependencies
234102
run: >-
235-
python -m pip install --only-binary "numpy,pandas,pyarrow,numexpr"
236-
-v . ./awkward-cpp/dist/*.whl
237-
pytest-github-actions-annotate-failures
238-
${{ matrix.extra-pip-constraints }}
103+
python -m pip install -v . ${{ steps.find-wheel.outputs.paths }} pytest-github-actions-annotate-failures
104+
-r "requirements-test-${{ matrix.dependencies-kind }}.txt"
239105
240106
- name: Print versions
241107
run: python -m pip list
242108

243109
- name: Check if kernel specification is sorted
244110
# We don't need to run this all the time
245-
if: matrix.python-version == '3.12'
111+
if: (matrix.python-version == '3.12') && (matrix.runs-on == 'ubuntu-latest')
246112
run: pipx run nox -s diagnostics -- --check-spec-sorted
247113

248114
- name: Test specification
@@ -257,20 +123,21 @@ jobs:
257123
if: steps.cache-awkward-cpp-wheel.outputs.cache-hit != 'true'
258124
run: python -m pytest -vv -rs awkward-cpp/tests-cpu-kernels
259125

260-
- name: Test
126+
- name: Test non-kernels
261127
run: >-
262128
python -m pytest -vv -rs tests --cov=awkward --cov-report=term
263129
--cov-report=xml
264130
265131
- name: Upload Codecov results
132+
if: (matrix.python-version == '3.9') && (matrix.runs-on == 'ubuntu-latest')
266133
uses: codecov/codecov-action@v3
267-
if: matrix.python-version == '3.9'
268134

269-
Linux-ROOT-dask-awkward:
135+
136+
Linux-ROOT:
270137
runs-on: ubuntu-20.04
271138

272139
env:
273-
PIP_ONLY_BINARY: cmake
140+
PIP_ONLY_BINARY: numpy,pandas,pyarrow,numexpr,numexpr
274141

275142
timeout-minutes: 30
276143

@@ -290,6 +157,7 @@ jobs:
290157
# Cache invalidates daily by default
291158
cache-environment: true
292159
environment-name: awkward
160+
# Need Python 3.8 for the cached wheels
293161
create-args: >-
294162
python=3.8
295163
numpy
@@ -311,13 +179,12 @@ jobs:
311179
python3 -m pip install build
312180
python3 -m build -w ./awkward-cpp
313181
314-
- name: Install awkward, awkward-cpp, dask-awkward, and dependencies
182+
- name: Install awkward, awkward-cpp, and dependencies
315183
run: >-
316184
python -m pip install --only-binary "numpy,pandas,pyarrow,numexpr"
317185
-v . ./awkward-cpp/dist/*.whl
318186
pytest-github-actions-annotate-failures
319-
dask-awkward
320-
-r requirements-test.txt
187+
-r requirements-test-full.txt
321188
322189
- name: Print versions
323190
run: python -m pip list
@@ -331,7 +198,7 @@ jobs:
331198
runs-on: ubuntu-22.04
332199

333200
env:
334-
PIP_ONLY_BINARY: cmake
201+
PIP_ONLY_BINARY: numpy,pandas,pyarrow,numexpr,numexpr
335202

336203
steps:
337204
- uses: actions/checkout@v4
@@ -364,14 +231,12 @@ jobs:
364231
with:
365232
image: "docker.io/agoose77/cppyy-wheels:cp311"
366233
path: "/wheels/."
367-
destination: "/tmp/cppyy-wheels"
234+
destination: "/tmp/wheelhouse"
368235

369236
- name: Install awkward, awkward-cpp, and dependencies
370237
run: >-
371-
python -m pip install --only-binary "numpy,pandas,pyarrow,numexpr"
372-
-v . ./awkward-cpp/dist/*.whl
373-
pytest-github-actions-annotate-failures
374-
/tmp/cppyy-wheels/*
238+
python -m pip install -v --only-binary "numpy,pandas,pyarrow,numexpr"
239+
./ ./awkward-cpp/dist/*.whl /tmp/wheelhouse/* pytest-github-actions-annotate-failures
375240
376241
- name: Print versions
377242
run: python -m pip list

noxfile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def tests(session):
3737
"""
3838
Run the unit and regular tests.
3939
"""
40-
session.install("-r", "requirements-test.txt", "./awkward-cpp", ".")
40+
session.install("-r", "requirements-test-full.txt", "./awkward-cpp", ".")
4141
session.run("pytest", *session.posargs if session.posargs else ["tests"])
4242

4343

@@ -65,7 +65,7 @@ def coverage(session):
6565
"""
6666
Run the unit and regular tests.
6767
"""
68-
session.install("-r", "requirements-test.txt", "./awkward-cpp", ".")
68+
session.install("-r", "requirements-test-full.txt", "./awkward-cpp", ".")
6969
session.run(
7070
"pytest", "tests", "--cov=awkward", "--cov-report=xml", *session.posargs
7171
)

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ include = [
8484
"/CITATION.cff",
8585
"/CONTRIBUTING.md",
8686
"/README.md",
87-
"/requirements-test.txt"
87+
"/requirements-test-full.txt",
88+
"/requirements-test-minimal.txt"
8889
]
8990
artifacts = [
9091
"/tests-cuda-kernels"
File renamed without changes.

0 commit comments

Comments
 (0)