Skip to content

Commit ae6a900

Browse files
committed
maint: add jobs to test wheels in CI
Add jobs to the wheel build GitHub Actions workflow that will install and test each built wheel in a fresh test runner. For each combination of Python version and OS (currently 3.7-3.10 and OSX/Linux) this will run a job that installs the wheel and runs the test script using the installed wheel. While this can give some basic confidence that the wheels do work it is still possible that these tests can pass in CI with wheels that would fail when transfered to another computer. At the time of this commit that is the case with the manylinux wheels which pass all tests but fail when installed to another Linux machine.
1 parent c849db5 commit ae6a900

1 file changed

Lines changed: 27 additions & 2 deletions

File tree

.github/workflows/buildwheel.yml

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ jobs:
77
name: Build wheels for ${{ matrix.os }}
88
runs-on: ${{ matrix.os }}
99
strategy:
10+
fail-fast: false
1011
matrix:
1112
# os: [ubuntu-20.04, windows-2019, macOS-10.15]
1213
os: [ubuntu-20.04, macOS-10.15]
1314

1415
steps:
15-
- uses: actions/checkout@v2
16+
- uses: actions/checkout@v3
1617
- uses: actions/setup-python@v2
1718

1819
- name: Build wheels
@@ -27,8 +28,32 @@ jobs:
2728
C_INCLUDE_PATH=$(pwd)/.local/include/
2829
LIBRARY_PATH=$(pwd)/.local/lib/
2930
LD_LIBRARY_PATH=$(pwd)/.local/lib:$LD_LIBRARY_PATH
30-
CIBW_TEST_COMMAND: "python -c \'import flint; assert str(flint.fmpq(3, 2)**2) == \"9/4\"\'"
31+
CIBW_TEST_COMMAND: python -c 'import flint; print(str(flint.fmpz(2)))'
3132

3233
- uses: actions/upload-artifact@v2
3334
with:
3435
path: wheelhouse/*.whl
36+
37+
test_wheels:
38+
needs: build_wheels
39+
name: Test ${{ matrix.python-version }} wheel on ${{ matrix.os }}
40+
runs-on: ${{ matrix.os }}
41+
strategy:
42+
fail-fast: false
43+
matrix:
44+
os: [ubuntu-20.04, macOS-10.15]
45+
python-version: ['3.7', '3.8', '3.9', '3.10']
46+
47+
steps:
48+
- uses: actions/checkout@v2
49+
- uses: actions/setup-python@v2
50+
with:
51+
python-version: ${{ matrix.python-version }}
52+
- uses: actions/download-artifact@v3
53+
with:
54+
name: artifact
55+
path: wheelhouse
56+
- run: python -m venv venv
57+
- run: venv/bin/pip install -U pip
58+
- run: venv/bin/pip install --find-links wheelhouse python_flint
59+
- run: venv/bin/python test/test.py

0 commit comments

Comments
 (0)