From fbed05af831058f359b6a96d833fb72ea9c4690d Mon Sep 17 00:00:00 2001 From: DaughterOfMars Date: Wed, 14 Aug 2024 10:52:37 -0400 Subject: [PATCH] chore(CI): Ensure that skipped workflows still report success (#1844) * chore(CI): Add workflow stubs for gated required flows * try using always() * temp * try another always() * more! * move it down the line * fix * Revert "temp" This reverts commit 19b23bdc4e48b54034143341884f1f0915b0a916. --- .github/workflows/_external_rust_lints.yml | 9 ++++++++- .github/workflows/_rust.yml | 14 +++++++++++++- .github/workflows/_rust_lints.yml | 9 ++++++++- .github/workflows/hierarchy.yml | 14 ++++++++------ 4 files changed, 37 insertions(+), 9 deletions(-) diff --git a/.github/workflows/_external_rust_lints.yml b/.github/workflows/_external_rust_lints.yml index b84ef3a1b69..6f45f99cc51 100644 --- a/.github/workflows/_external_rust_lints.yml +++ b/.github/workflows/_external_rust_lints.yml @@ -1,9 +1,14 @@ name: Rust lints -on: workflow_call +on: + workflow_call: + inputs: + isRust: + type: boolean jobs: rustfmt: + if: always() && inputs.isRust runs-on: [self-hosted] steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1 @@ -14,6 +19,7 @@ jobs: cargo +nightly ci-fmt-external cargo-deny: + if: always() && inputs.isRust name: cargo-deny (advisories, licenses, bans, ...) runs-on: [self-hosted] steps: @@ -21,6 +27,7 @@ jobs: - uses: EmbarkStudios/cargo-deny-action@v1 clippy: + if: always() && inputs.isRust needs: - rustfmt - cargo-deny diff --git a/.github/workflows/_rust.yml b/.github/workflows/_rust.yml index c8a4d3267e3..19c795a6d40 100644 --- a/.github/workflows/_rust.yml +++ b/.github/workflows/_rust.yml @@ -1,6 +1,10 @@ name: Rust crates -on: workflow_call +on: + workflow_call: + inputs: + isRust: + type: boolean env: CARGO_TERM_COLOR: always @@ -28,29 +32,37 @@ env: jobs: rust-lints: uses: ./.github/workflows/_rust_lints.yml + with: + isRust: ${{ inputs.isRust }} external-lints: uses: ./.github/workflows/_external_rust_lints.yml + with: + isRust: ${{ inputs.isRust }} rust-tests: + if: inputs.isRust needs: - rust-lints - external-lints uses: ./.github/workflows/_rust_tests.yml external-tests: + if: inputs.isRust needs: - rust-lints - external-lints uses: ./.github/workflows/_external_rust_tests.yml mysticeti-tests: + if: inputs.isRust needs: - rust-lints - external-lints uses: ./.github/workflows/_mysticeti_tests.yml execution-cut: + if: inputs.isRust needs: - rust-tests - external-tests diff --git a/.github/workflows/_rust_lints.yml b/.github/workflows/_rust_lints.yml index ad86bee0f5a..759e61d50f0 100644 --- a/.github/workflows/_rust_lints.yml +++ b/.github/workflows/_rust_lints.yml @@ -1,9 +1,14 @@ name: Rust lints -on: workflow_call +on: + workflow_call: + inputs: + isRust: + type: boolean jobs: rustfmt: + if: always() && inputs.isRust runs-on: [self-hosted] steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1 @@ -13,6 +18,7 @@ jobs: run: cargo +nightly ci-fmt cargo-deny: + if: always() && inputs.isRust name: cargo-deny (advisories, licenses, bans, ...) runs-on: [self-hosted] steps: @@ -20,6 +26,7 @@ jobs: - uses: EmbarkStudios/cargo-deny-action@v1 clippy: + if: always() && inputs.isRust needs: - rustfmt - cargo-deny diff --git a/.github/workflows/hierarchy.yml b/.github/workflows/hierarchy.yml index a914a7f88a4..5f0e77c3d63 100644 --- a/.github/workflows/hierarchy.yml +++ b/.github/workflows/hierarchy.yml @@ -49,7 +49,7 @@ jobs: license-check: name: license-check needs: diff - if: ${{ needs.diff.outputs.isRust == 'true' }} + if: ${{ always() && needs.diff.outputs.isRust == 'true' }} runs-on: [self-hosted] steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1 @@ -58,18 +58,18 @@ jobs: docusaurus: needs: diff - if: ${{ needs.diff.outputs.isDoc == 'true' }} + if: ${{ always() && needs.diff.outputs.isDoc == 'true' }} uses: ./.github/workflows/_docusaurus.yml docs-lint: needs: diff - if: ${{ needs.diff.outputs.isDoc == 'true' }} + if: ${{ always() && needs.diff.outputs.isDoc == 'true' }} uses: ./.github/workflows/_docs_lint.yml release-notes-description-check: name: release-notes-check needs: diff - if: ${{ needs.diff.outputs.isReleaseNotesEligible == 'true' }} + if: ${{ always() && needs.diff.outputs.isReleaseNotesEligible == 'true' }} runs-on: [self-hosted] steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1 @@ -102,7 +102,7 @@ jobs: - dprint-format - license-check - typos - if: ${{ needs.diff.outputs.isRust == 'false' && needs.diff.outputs.isMove == 'true' }} + if: ${{ always() && needs.diff.outputs.isRust == 'false' && needs.diff.outputs.isMove == 'true' }} uses: ./.github/workflows/_move_tests.yml rust: @@ -111,8 +111,10 @@ jobs: - dprint-format - license-check - typos - if: ${{ needs.diff.outputs.isRust == 'true' }} + if: always() uses: ./.github/workflows/_rust.yml + with: + isRust: ${{ needs.diff.outputs.isRust == 'true' }} e2e: needs: