Skip to content

Commit 7b65aaf

Browse files
committed
🧪💅 Merge Ubuntu test matrices in CI
Previously, they were duplicated, with custom commands being passed to the same reusable workflow. This patch moves the commands in and adds a matrix resembling the interface of other OS tests.
1 parent 8b209fd commit 7b65aaf

File tree

2 files changed

+20
-26
lines changed

2 files changed

+20
-26
lines changed

‎.github/workflows/build.yml

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -222,31 +222,20 @@ jobs:
222222
os-matrix: '["ghcr.io/cirruslabs/macos-runner:sonoma", "macos-14"]'
223223

224224
build_ubuntu:
225-
name: 'Ubuntu'
226-
needs: check_source
227-
if: needs.check_source.outputs.run_tests == 'true'
228-
uses: ./.github/workflows/reusable-ubuntu.yml
229-
with:
230-
config_hash: ${{ needs.check_source.outputs.config_hash }}
231-
options: |
232-
../cpython-ro-srcdir/configure \
233-
--config-cache \
234-
--with-pydebug \
235-
--with-openssl=$OPENSSL_DIR
236-
237-
build_ubuntu_free_threading:
238-
name: 'Ubuntu (free-threading)'
225+
name: >-
226+
Ubuntu
227+
${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
239228
needs: check_source
240229
if: needs.check_source.outputs.run_tests == 'true'
230+
strategy:
231+
matrix:
232+
free-threading:
233+
- false
234+
- true
241235
uses: ./.github/workflows/reusable-ubuntu.yml
242236
with:
243237
config_hash: ${{ needs.check_source.outputs.config_hash }}
244-
options: |
245-
../cpython-ro-srcdir/configure \
246-
--config-cache \
247-
--with-pydebug \
248-
--with-openssl=$OPENSSL_DIR \
249-
--disable-gil
238+
free-threading: ${{ matrix.free-threading }}
250239

251240
build_ubuntu_ssltests:
252241
name: 'Ubuntu SSL tests with OpenSSL'
@@ -558,7 +547,6 @@ jobs:
558547
- build_macos
559548
- build_macos_free_threading
560549
- build_ubuntu
561-
- build_ubuntu_free_threading
562550
- build_ubuntu_ssltests
563551
- build_wasi
564552
- build_windows
@@ -593,7 +581,6 @@ jobs:
593581
build_macos,
594582
build_macos_free_threading,
595583
build_ubuntu,
596-
build_ubuntu_free_threading,
597584
build_ubuntu_ssltests,
598585
build_wasi,
599586
build_windows,

‎.github/workflows/reusable-ubuntu.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ on:
44
config_hash:
55
required: true
66
type: string
7-
options:
8-
required: true
9-
type: string
7+
free-threading:
8+
description: Whether to use no-GIL mode
9+
required: false
10+
type: boolean
11+
default: false
1012

1113
jobs:
1214
build_ubuntu_reusable:
@@ -63,7 +65,12 @@ jobs:
6365
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ inputs.config_hash }}
6466
- name: Configure CPython out-of-tree
6567
working-directory: ${{ env.CPYTHON_BUILDDIR }}
66-
run: ${{ inputs.options }}
68+
run: >-
69+
../cpython-ro-srcdir/configure
70+
--config-cache
71+
--with-pydebug
72+
--with-openssl=$OPENSSL_DIR
73+
${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }}
6774
- name: Build CPython out-of-tree
6875
working-directory: ${{ env.CPYTHON_BUILDDIR }}
6976
run: make -j4

0 commit comments

Comments
 (0)