Skip to content

Commit 4facf8f

Browse files
Merge #1059
1059: Ensure successful CI conclusion with empty matrix. r=Emilgardis a=Alexhuszagh Closes #1043. Co-authored-by: Alex Huszagh <[email protected]>
2 parents 278cc19 + ea025c0 commit 4facf8f

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

.github/workflows/ci.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ jobs:
9191
steps:
9292
- uses: actions/checkout@v3
9393
- uses: ./.github/actions/setup-rust
94+
9495
- name: Generate matrix
9596
id: generate-matrix
9697
run: cargo xtask ci-job target-matrix
@@ -102,7 +103,7 @@ jobs:
102103
name: target (${{ matrix.pretty }},${{ matrix.os }})
103104
runs-on: ${{ matrix.os }}
104105
needs: [shellcheck, test, generate-matrix, check]
105-
if: github.event_name == 'push'
106+
if: github.event_name == 'push' && needs.generate-matrix.outputs.matrix != '{}' && needs.generate-matrix.outputs.matrix != '[]' && needs.generate-matrix.outputs.matrix != ''
106107
strategy:
107108
fail-fast: false
108109
matrix:

xtask/src/ci/target_matrix.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ pub(crate) fn run(message: String, author: String) -> Result<(), color_eyre::Rep
3232
std: target.std.map(|b| b as u8),
3333
})
3434
.collect::<Vec<_>>();
35-
gha_output("matrix", &serde_json::to_string(&matrix)?);
35+
let json = serde_json::to_string(&matrix)?;
36+
gha_print(&json);
37+
gha_output("matrix", &json);
3638
Ok(())
3739
}
3840

0 commit comments

Comments
 (0)