7
7
# Enable Run Workflow button in GitHub UI
8
8
workflow_dispatch :
9
9
10
+ push :
11
+ branches : [ main ]
12
+
13
+ pull_request :
14
+
10
15
concurrency :
11
16
group : ${{ github.workflow }}-${{ github.ref }}
12
17
cancel-in-progress : true
@@ -34,55 +39,47 @@ jobs:
34
39
build_wheels :
35
40
name : Wheels - ${{ matrix.cibw_archs }} - ${{ matrix.os }}
36
41
runs-on : ${{ matrix.os }}
42
+ env :
43
+ # graphblas version to use if another one is not provided
44
+ default-graphblas-version : " 8.2.0"
45
+
37
46
strategy :
38
47
fail-fast : false
39
48
matrix :
40
- # Loosely based on scikit-learn's config:
41
- # https://github.com/scikit-learn/scikit-learn/blob/main/.github/workflows/wheels.yml
42
49
include :
43
50
- os : windows-latest
44
- python-version : " 3.8"
45
- platform_id : win_amd64
46
- cibw_archs : " auto"
51
+ cibw_archs : " auto64"
47
52
48
- # Linux 64 bit manylinux2014
53
+ # Linux x86
49
54
- os : ubuntu-latest
50
- python-version : " 3.8"
51
- platform_id : manylinux_x86_64
52
- manylinux_image : manylinux2014
53
- cibw_archs : " native"
55
+ cibw_archs : " x86_64"
56
+ # skip musllinux
57
+ cibw_skip : " *musl*"
54
58
55
- # Linux 64 bit manylinux2014 for aarch64
59
+ # Linux aarch64
56
60
# Separate runner because this requires emulation (only x86 runners are available) and is very slow.
57
61
- os : ubuntu-latest
58
- python-version : " 3.8"
59
- platform_id : manylinux_x86_64
60
- manylinux_image : manylinux2014
61
62
cibw_archs : " aarch64"
63
+ # numpy wheels not available for aarch64 PyPy or musllinux
64
+ cibw_skip : " pp* *musl*"
62
65
63
66
# macOS x86
64
67
- os : macos-latest
65
- python-version : " 3.8"
66
- platform_id : macosx_x86_64
67
68
cibw_archs : " x86_64"
68
69
69
- # Use x86 macOS runner to build ARM .
70
+ # macOS Apple Silicon cross-compiled on x86 macOS runner .
70
71
# GitHub does not offer Apple Silicon yet (only for self-hosted).
71
72
# See https://github.com/github/roadmap/issues/528
72
73
- os : macos-latest
73
- python-version : " 3.8"
74
- platform_id : macosx_x86_64
75
74
cibw_archs : " arm64"
75
+ # Skip macOS ARM tests on Intel runner.
76
+ cibw_test_skip : " *-macosx_arm64"
76
77
77
78
steps :
78
79
- uses : actions/checkout@v4
79
80
with :
80
81
fetch-depth : 0
81
82
82
- - uses : actions/setup-python@v4
83
- with :
84
- python-version : ${{ matrix.python-version }}
85
-
86
83
# aarch64 Linux builds are cross-compiled on x86 runners using emulation
87
84
# see https://cibuildwheel.readthedocs.io/en/stable/faq/#emulation
88
85
- name : Setup QEMU (for aarch64)
98
95
run : |
99
96
echo "SUITESPARSE_FAST_BUILD=1" >> $GITHUB_ENV
100
97
98
+ - name : Setup for testing
99
+ if : github.event_name == 'push' || github.event_name == 'pull_request'
100
+ # Ask suitesparse.sh to compile in the fastest way possible and provide a GB version to build
101
+ run : |
102
+ echo "SUITESPARSE_FASTEST_BUILD=1" >> $GITHUB_ENV
103
+ echo "GB_VERSION_REF=refs/tags/${{ env.default-graphblas-version }}.0" >> $GITHUB_ENV
104
+ shell : bash
105
+
106
+ - name : Setup GraphBLAS version from git tag
107
+ if : ${{ startsWith(github.ref, 'refs/tags/') }}
108
+ # If this is a tagged ref, like a release, then use the tag for the graphblas version
109
+ run : echo "GB_VERSION_REF=${{ github.ref }}" >> $GITHUB_ENV
110
+ shell : bash
111
+
101
112
- name : Install tools (macOS)
102
113
if : contains(matrix.os, 'macos')
103
114
# Install coreutils which includes `nproc` used by `make -j` in suitesparse.sh
@@ -112,18 +123,20 @@ jobs:
112
123
sh add_arm_to_libomp_dylib.sh
113
124
fi
114
125
115
- - name : Build Wheels
126
+
127
+ with :
128
+ output-dir : wheelhouse
116
129
env :
117
130
# very verbose
118
131
CIBW_BUILD_VERBOSITY : 3
119
132
120
133
# Build SuiteSparse
121
- CIBW_BEFORE_ALL : bash suitesparse.sh ${{ github.ref }}
134
+ CIBW_BEFORE_ALL : bash suitesparse.sh ${{ env.GB_VERSION_REF }}
122
135
123
136
# Install FFI dev library, needed for Python 3.12
124
137
CIBW_BEFORE_BUILD_LINUX : yum install -y libffi-devel
125
138
126
- CIBW_ENVIRONMENT_LINUX : SUITESPARSE_FAST_BUILD=${{ env.SUITESPARSE_FAST_BUILD }}
139
+ CIBW_ENVIRONMENT_PASS_LINUX : SUITESPARSE_FAST_BUILD SUITESPARSE_FASTEST_BUILD
127
140
128
141
# CMAKE_GNUtoMS=ON asks suitesparse.sh to build libraries in MSVC style on Windows.
129
142
CIBW_ENVIRONMENT_WINDOWS : CMAKE_GNUtoMS=ON GRAPHBLAS_PREFIX="C:/GraphBLAS"
@@ -138,11 +151,8 @@ jobs:
138
151
# Architectures to build specified in matrix
139
152
CIBW_ARCHS : ${{ matrix.cibw_archs }}
140
153
141
- # No 32-bit builds
142
- # no musllinux
143
- # no PyPy aarch64 (only due to build speed, numpy does not ship aarch64 pypy wheels)
144
154
# as of writing numpy does not support pypy 3.10
145
- CIBW_SKIP : " *-win32 *_i686 *musl* pp*aarch64 pp310*"
155
+ CIBW_SKIP : " ${{ matrix.cibw_skip }} pp310*"
146
156
147
157
# Use delvewheel on Windows.
148
158
# This copies graphblas.dll into the wheel. "repair" in cibuildwheel parlance includes copying any shared
@@ -159,14 +169,7 @@ jobs:
159
169
# run tests
160
170
CIBW_TEST_COMMAND : " pytest --pyargs suitesparse_graphblas -s -k test_print_jit_config && pytest -v --pyargs suitesparse_graphblas"
161
171
162
- # GitHub Actions macOS Intel runner cannot run ARM tests. Uncomment to silence warning.
163
- CIBW_TEST_SKIP : " *-macosx_arm64"
164
-
165
- run : |
166
- python -m pip install --upgrade pip
167
- python -m pip install cibuildwheel
168
- python -m cibuildwheel --output-dir wheelhouse .
169
- shell : bash
172
+ CIBW_TEST_SKIP : ${{ matrix.cibw_test_skip }}
170
173
171
174
- uses : actions/upload-artifact@v3
172
175
id : uploadAttempt1
@@ -189,8 +192,8 @@ jobs:
189
192
name : Upload to PyPI
190
193
needs : [build_wheels, build_sdist]
191
194
runs-on : ubuntu-latest
192
- if : github.repository == 'GraphBLAS/python-suitesparse-graphblas'
193
- # if: github.event_name == 'release' && github.event.action == 'published'
195
+ # only upload releases to PyPI
196
+ if : github.repository == 'GraphBLAS/python-suitesparse-graphblas' && github.event_name == 'release' && github.event.action == 'published'
194
197
195
198
steps :
196
199
- uses : actions/setup-python@v4
@@ -212,4 +215,4 @@ jobs:
212
215
213
216
# Test PyPI:
214
217
# password: ${{ secrets.TEST_PYPI_API_TOKEN }}
215
- # repository_url : https://test.pypi.org/legacy/
218
+ # repository-url : https://test.pypi.org/legacy/
0 commit comments