13
13
runs-on : ubuntu-latest
14
14
outputs :
15
15
MSRV : ${{ steps.resolve-msrv.outputs.MSRV }}
16
+ full-build : ${{ startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main' || contains(github.event.pull_request.labels.*.name, 'Full Build') }}
16
17
steps :
17
18
- uses : actions/checkout@v4
18
19
68
69
path : dist
69
70
70
71
build :
72
+ needs : [resolve]
71
73
name : build on ${{ matrix.os }} / ${{ matrix.target }}
72
- # only run on push to main and on release
73
- if : startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main' || contains(github.event.pull_request.labels.*.name, 'Full Build')
74
+ if : ${{ needs.resolve.outputs.full-build == 'true' }}
74
75
strategy :
75
76
fail-fast : false
76
77
matrix :
@@ -142,61 +143,24 @@ jobs:
142
143
ls dist/*py3-none-*linux*x86_64.whl | head -n 1
143
144
python -m zipfile --list `ls dist/*py3-none-*linux*x86_64.whl | head -n 1`
144
145
145
- test-builds-arch :
146
- name : test build on ${{ matrix.target }}-${{ matrix.distro }}
147
- needs : [build]
148
- runs-on : ubuntu-latest
149
-
150
- strategy :
151
- fail-fast : false
152
- matrix :
153
- target : [aarch64, armv7, s390x, ppc64le]
154
- distro : ["ubuntu22.04"]
155
- include :
156
- - target : aarch64
157
- distro : alpine_latest
158
-
159
- steps :
160
- - uses : actions/checkout@v4
161
-
162
- - name : get dist artifacts
163
- uses : actions/download-artifact@v4
164
- with :
165
- pattern : pypi_files_linux_*
166
- merge-multiple : true
167
- path : dist
168
-
169
- - uses : uraimo/run-on-arch-action@v2
170
- name : install & test
171
- with :
172
- arch : ${{ matrix.target }}
173
- distro : ${{ matrix.distro }}
174
- githubToken : ${{ github.token }}
175
- install : |
176
- set -x
177
- if command -v apt-get &> /dev/null; then
178
- echo "installing python & pip with apt-get..."
179
- apt-get update
180
- apt-get install -y --no-install-recommends python3 python3-pip python3-venv git
181
- else
182
- echo "installing python & pip with apk..."
183
- apk update
184
- apk add python3 py3-pip git
185
- fi
186
- run : |
187
- python3 -m pip install mcpdb --no-index --no-deps --find-links dist --force-reinstall
188
- python3 -m mcpdb --help
189
-
190
- test-builds-os :
146
+ test-builds :
191
147
name : test build on ${{ matrix.os }}
192
148
needs : [build]
193
149
194
150
strategy :
195
151
fail-fast : false
196
152
matrix :
197
- os : [ubuntu, macos, windows]
153
+ os : [windows, macos, linux]
154
+ target : [x86_64, aarch64]
155
+ # onyx runtime seems to have issues with these targets, need to find alternative
156
+ # solution, fine to skip for now.
157
+ exclude :
158
+ - os : windows
159
+ target : aarch64
160
+ - os : linux
161
+ target : aarch64
198
162
199
- runs-on : ${{ matrix.os }}-latest
163
+ runs-on : ${{ (matrix.os == 'linux' && 'ubuntu') || matrix.os }}-latest
200
164
steps :
201
165
- uses : actions/checkout@v4
202
166
@@ -215,25 +179,22 @@ jobs:
215
179
- name : run tests
216
180
run : |
217
181
python3 -m pip install mcpdb --no-index --no-deps --find-links dist --force-reinstall
218
- python3 -m mcpdb --help
182
+ mcpdb --help
219
183
220
184
# https://github.com/marketplace/actions/alls-green#why used for branch protection checks
221
185
check :
222
186
if : always()
223
- needs : [lint]
187
+ needs : [resolve, lint, test-builds, build-sdist ]
224
188
runs-on : ubuntu-latest
225
189
steps :
226
190
- name : Decide whether the needed jobs succeeded or failed
227
191
uses : re-actors/alls-green@release/v1
228
192
with :
229
193
jobs : ${{ toJSON(needs) }}
194
+ allowed-skips : ${{ needs.resolve.outputs.full-build == 'true' && '' || 'test-builds' }}
230
195
231
196
release :
232
- needs :
233
- - check
234
- - test-builds-arch
235
- - test-builds-os
236
- - build-sdist
197
+ needs : [check]
237
198
if : success() && startsWith(github.ref, 'refs/tags/')
238
199
runs-on : ubuntu-latest
239
200
environment : release
0 commit comments