Skip to content

Commit 0afc5b9

Browse files
refactor: use matrix strategy for package builds
Convert the package job to use a matrix strategy to build vcs-versioning and setuptools-scm in separate, isolated jobs. This avoids shared state issues between builds entirely. Changes: - Added matrix with two entries (vcs-versioning and setuptools-scm) - Each matrix job runs independently with its own baipp environment - Removed cleanup step between builds (no longer needed with isolation) - Job names now show which package is being built This is cleaner than cleaning up artifacts between builds and prevents potential race conditions or shared state bugs.
1 parent e3ec938 commit 0afc5b9

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed

.github/workflows/python-tests.yml

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,17 @@ env:
2020
jobs:
2121

2222
package:
23-
name: Build & inspect our packages
23+
name: Build & inspect ${{ matrix.name }}
2424
runs-on: ubuntu-latest
25+
strategy:
26+
matrix:
27+
include:
28+
- name: vcs-versioning
29+
path: nextgen/vcs-versioning
30+
suffix: -vcs-versioning
31+
- name: setuptools-scm
32+
path: .
33+
suffix: -setuptools-scm
2534
env:
2635
# Use no-local-version for package builds to ensure clean versions for PyPI uploads
2736
SETUPTOOLS_SCM_NO_LOCAL: "1"
@@ -31,23 +40,11 @@ jobs:
3140
with:
3241
fetch-depth: 0
3342

34-
- name: Build vcs-versioning
35-
uses: hynek/build-and-inspect-python-package@v2
36-
with:
37-
path: nextgen/vcs-versioning
38-
upload-name-suffix: -vcs-versioning
39-
40-
- name: Clean up baipp artifacts between builds
41-
run: |
42-
if [ -d "/tmp/baipp/dist/out" ]; then
43-
echo "::warning::Found leftover /tmp/baipp/dist/out directory from previous build, removing it"
44-
rm -rf /tmp/baipp/dist/out
45-
fi
46-
47-
- name: Build setuptools-scm
43+
- name: Build ${{ matrix.name }}
4844
uses: hynek/build-and-inspect-python-package@v2
4945
with:
50-
upload-name-suffix: -setuptools-scm
46+
path: ${{ matrix.path }}
47+
upload-name-suffix: ${{ matrix.suffix }}
5148

5249
test:
5350
needs: [package]

0 commit comments

Comments
 (0)