Skip to content

Commit

Permalink
chore(CI): Ensure that skipped workflows still report success (#1844)
Browse files Browse the repository at this point in the history
* 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 19b23bd.
  • Loading branch information
DaughterOfMars authored Aug 14, 2024
1 parent 99e575f commit fbed05a
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 9 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/_external_rust_lints.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -14,13 +19,15 @@ jobs:
cargo +nightly ci-fmt-external
cargo-deny:
if: always() && inputs.isRust
name: cargo-deny (advisories, licenses, bans, ...)
runs-on: [self-hosted]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1
- uses: EmbarkStudios/cargo-deny-action@v1

clippy:
if: always() && inputs.isRust
needs:
- rustfmt
- cargo-deny
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/_rust.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Rust crates

on: workflow_call
on:
workflow_call:
inputs:
isRust:
type: boolean

env:
CARGO_TERM_COLOR: always
Expand Down Expand Up @@ -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
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/_rust_lints.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -13,13 +18,15 @@ jobs:
run: cargo +nightly ci-fmt

cargo-deny:
if: always() && inputs.isRust
name: cargo-deny (advisories, licenses, bans, ...)
runs-on: [self-hosted]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1
- uses: EmbarkStudios/cargo-deny-action@v1

clippy:
if: always() && inputs.isRust
needs:
- rustfmt
- cargo-deny
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/hierarchy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down

0 comments on commit fbed05a

Please sign in to comment.