Skip to content

Commit 96e6eab

Browse files
how about this
1 parent 86822fa commit 96e6eab

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
generate-matrix:
2020
runs-on: ubuntu-latest
2121
outputs:
22-
matrix: ${{ steps.set-matrix.outputs.matrix }}
22+
include: ${{ steps.set-matrix.outputs.include }}
2323
steps:
2424
- uses: actions/checkout@v4
2525

@@ -29,7 +29,7 @@ jobs:
2929
enable-cache: true
3030
pyproject-file: pyproject.toml
3131

32-
- id: set-matrix
32+
- id: set-include
3333
run: |
3434
uv run noxfile.py --session gha_matrix
3535
@@ -40,7 +40,7 @@ jobs:
4040
strategy:
4141
fail-fast: false
4242
matrix:
43-
include: ${{ fromJSON(needs.generate-matrix.outputs.matrix.include) }}
43+
include: ${{ fromJSON(needs.generate-matrix.outputs.matrix) }}
4444
steps:
4545
- uses: actions/checkout@v4
4646

noxfile.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -124,19 +124,17 @@ def lint(session):
124124

125125
@nox.session
126126
def gha_matrix(session):
127-
sessions = session.run("nox", "-l", "--json", silent=True)
128-
matrix = {
129-
"include": [
130-
{
131-
"django-version": session["call_spec"]["django"],
132-
"python-version": session["python"],
133-
}
134-
for session in json.loads(sessions)
135-
if session["name"] == "tests"
136-
]
137-
}
127+
sessions = session.run("nox", "-l", "--json", external=True, silent=True)
128+
matrix = [
129+
{
130+
"django-version": session["call_spec"]["django"],
131+
"python-version": session["python"],
132+
}
133+
for session in json.loads(sessions)
134+
if session["name"] == "tests"
135+
]
138136
with Path(os.environ["GITHUB_OUTPUT"]).open("a") as fh:
139-
print(f"matrix={matrix}", file=fh)
137+
print(f"include={matrix}", file=fh)
140138

141139

142140
if __name__ == "__main__":

0 commit comments

Comments
 (0)