Skip to content

Commit ab2676b

Browse files
let's try to pass in the os, so we can call it from release to test ALL
1 parent de1aa42 commit ab2676b

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

.github/workflows/test.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ on:
55
push:
66
branches: [main]
77
workflow_call:
8+
inputs:
9+
os:
10+
default: "ubuntu-latest"
11+
description: "Comma-delineated list of OS targets to run tests on"
12+
required: false
13+
type: string
814

915
concurrency:
1016
group: test-${{ github.head_ref }}
@@ -19,7 +25,8 @@ jobs:
1925
generate-matrix:
2026
runs-on: ubuntu-latest
2127
outputs:
22-
include: ${{ steps.set-matrix.outputs.include }}
28+
include: ${{ steps.set-version-matrix.outputs.include }}
29+
os: ${{ steps.set-os-matrix.outputs.os }}
2330
steps:
2431
- uses: actions/checkout@v4
2532

@@ -29,17 +36,23 @@ jobs:
2936
enable-cache: true
3037
pyproject-file: pyproject.toml
3138

32-
- id: set-matrix
39+
- id: set-version-matrix
3340
run: |
3441
uv run noxfile.py --session gha_matrix
3542
43+
- id: set-os-matrix
44+
run: |
45+
# -R reads raw string, split(",") creates array, map(gsub(...)) trims whitespace, -c outputs compact JSON
46+
echo "os=$(echo "${{ inputs.os }}" | jq -R -c 'split(",") | map(gsub("^ *| *$"; ""))')" >> "$GITHUB_OUTPUT"
47+
3648
test:
37-
name: Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }}
38-
runs-on: ubuntu-latest
49+
name: Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }} (${{ matrix.os }})
50+
runs-on: ${{ matrix.os }}
3951
needs: generate-matrix
4052
strategy:
4153
fail-fast: false
4254
matrix:
55+
os: ${{ fromJSON(needs.generate-matrix.outputs.os) }}
4356
include: ${{ fromJSON(needs.generate-matrix.outputs.include) }}
4457
steps:
4558
- uses: actions/checkout@v4

0 commit comments

Comments
 (0)