Skip to content

Commit 0ac42b4

Browse files
committed
fixup, skip matrix if there are no jobs in it
1 parent b7ffe0e commit 0ac42b4

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

.github/workflows/build-notebooks-pr.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515
outputs:
1616
matrix: ${{ steps.gen.outputs.matrix }}
17+
has_jobs: ${{ steps.gen.outputs.has_jobs }}
1718
steps:
1819
- uses: actions/checkout@v4
1920

@@ -27,13 +28,13 @@ jobs:
2728
env:
2829
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2930
30-
# base images
3131
build:
3232
needs: ["gen"]
3333
strategy:
3434
fail-fast: false
3535
matrix: "${{ fromJson(needs.gen.outputs.matrix) }}"
3636
uses: ./.github/workflows/build-notebooks-TEMPLATE.yaml
37+
if: ${{ fromJson(needs.gen.outputs.has_jobs) }}
3738
with:
3839
target: "${{ matrix.target }}"
3940
github: "${{ toJSON(github) }}"

ci/cached-builds/gen_gha_matrix_jobs.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,8 @@ def print_github_actions_pr_matrix(tree: dict[str, list[str]], leafs: list[str])
144144
targets.append(leaf)
145145

146146
matrix = {"target": targets}
147-
return [f"matrix={json.dumps(matrix, separators=(',', ':'))}"]
147+
return [f"matrix={json.dumps(matrix, separators=(',', ':'))}",
148+
f"has_jobs={json.dumps(len(leafs) > 0, separators=(',', ':'))}"]
148149

149150

150151
def main() -> None:

0 commit comments

Comments
 (0)