Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(CI): Add hierarchy complete flag job that can be required #3912

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/_external_rust_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ env:
jobs:
test:
name: Test external crates
if: (!cancelled())
env:
# Tests written with #[sim_test] are often flaky if run as #[tokio::test] - this var
# causes #[sim_test] to only run under the deterministic `simtest` job, and not the
Expand Down Expand Up @@ -62,7 +61,6 @@ jobs:

check-unused-deps:
name: Check Unused Dependencies (${{ matrix.flags }})
if: (!cancelled())
strategy:
matrix:
flags: ["--all-features", "--no-default-features"]
Expand Down
20 changes: 5 additions & 15 deletions .github/workflows/_rust.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: Rust

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

env:
CARGO_TERM_COLOR: always
Expand Down Expand Up @@ -32,8 +28,6 @@ env:
jobs:
rust-lints:
uses: ./.github/workflows/_rust_lints.yml
with:
isRust: ${{ inputs.isRust }}

deny:
uses: ./.github/workflows/_cargo_deny.yml
Expand Down Expand Up @@ -65,24 +59,20 @@ jobs:
filters: .github/external-crates-filters.yml

crates-tests:
if: |
!cancelled() && !failure() && inputs.isRust && github.event.pull_request.draft == false
if: github.event.pull_request.draft == false
needs: crates-changes
uses: ./.github/workflows/_rust_tests.yml
with:
changedCrates: ${{ join(fromJson(needs.crates-changes.outputs.components), ' ') }}

external-tests:
if: |
!cancelled() && !failure() && inputs.isRust && github.event.pull_request.draft == false
if: github.event.pull_request.draft == false
needs: external-changes
uses: ./.github/workflows/_external_rust_tests.yml
with:
changedCrates: ${{ join(fromJson(needs.external-changes.outputs.components), ' ') }}

execution-cut:
if: |
!cancelled() && !failure() && inputs.isRust && github.event.pull_request.draft == false
needs:
- rust-lints
if: github.event.pull_request.draft == false
needs: rust-lints
uses: ./.github/workflows/_execution_cut.yml
12 changes: 2 additions & 10 deletions .github/workflows/_rust_lints.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: Rust lints

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

concurrency:
group: rust-lints-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand All @@ -18,7 +14,6 @@ env:

jobs:
rustfmt:
if: (!cancelled() && inputs.isRust)
runs-on: [self-hosted]
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
Expand All @@ -28,7 +23,6 @@ jobs:
run: cargo +nightly ci-fmt

cargo-sort:
if: (!cancelled() && inputs.isRust)
runs-on: [self-hosted]
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
Expand All @@ -46,9 +40,7 @@ jobs:
fi

clippy:
if: (!cancelled() && !failure() && inputs.isRust)
needs:
- rustfmt
needs: rustfmt
runs-on: [self-hosted]
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/_rust_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ env:
jobs:
test:
name: Test rust crates
if: (!cancelled())
env:
# Tests written with #[sim_test] are often flaky if run as #[tokio::test] - this var
# causes #[sim_test] to only run under the deterministic `simtest` job, and not the
Expand Down Expand Up @@ -67,7 +66,6 @@ jobs:

check-unused-deps:
name: Check Unused Dependencies (${{ matrix.flags }})
if: (!cancelled())
strategy:
matrix:
flags: ["--all-features", "--no-default-features"]
Expand Down
39 changes: 27 additions & 12 deletions .github/workflows/hierarchy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
group: license-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
needs: diff
if: (!cancelled() && needs.diff.outputs.isRust == 'true')
if: needs.diff.outputs.isRust == 'true'
runs-on: [self-hosted]
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
Expand All @@ -69,12 +69,12 @@ jobs:

docusaurus:
needs: diff
if: (!cancelled() && needs.diff.outputs.isDoc == 'true' && !github.event.pull_request.draft)
if: needs.diff.outputs.isDoc == 'true' && !github.event.pull_request.draft
uses: ./.github/workflows/_docusaurus.yml

docs-lint:
needs: diff
if: (!cancelled() && needs.diff.outputs.isDoc == 'true')
if: needs.diff.outputs.isDoc == 'true'
uses: ./.github/workflows/_docs_lint.yml

turborepo:
Expand All @@ -90,7 +90,6 @@ jobs:
- license-check
- typos
if: |
!cancelled() && !failure() &&
needs.diff.outputs.isRust == 'false' &&
needs.diff.outputs.isMove == 'true' &&
github.event.pull_request.draft == false
Expand All @@ -102,11 +101,8 @@ jobs:
- dprint-format
- license-check
- typos
if: (!cancelled() && !failure())
if: needs.diff.outputs.isRust == 'true'
uses: ./.github/workflows/_rust.yml
secrets: inherit
with:
isRust: ${{ needs.diff.outputs.isRust == 'true' }}

rosetta:
needs:
Expand All @@ -120,7 +116,7 @@ jobs:
uses: ./.github/workflows/_rosetta.yml

e2e:
if: (!cancelled() && !failure() && (!github.event.pull_request.draft || github.ref_name == 'develop'))
if: (!github.event.pull_request.draft || github.ref_name == 'develop')
needs:
- diff
- dprint-format
Expand All @@ -136,7 +132,6 @@ jobs:
isGraphQlTransport: ${{ needs.diff.outputs.isGraphQlTransport == 'true' }}

vercel-deploy:
if: (!cancelled() && !failure())
needs:
- diff
- dprint-format
Expand All @@ -153,7 +148,7 @@ jobs:
isWalletDashboard: ${{ needs.diff.outputs.isWalletDashboard == 'true' }}

ledgernano:
if: (!cancelled() && !failure()) && needs.diff.outputs.isLedgerjs == 'true' && github.event.pull_request.draft == false
if: needs.diff.outputs.isLedgerjs == 'true' && github.event.pull_request.draft == false
needs:
- diff
- dprint-format
Expand All @@ -163,10 +158,30 @@ jobs:
secrets: inherit

move-ide:
if: (!cancelled() && !failure()) && needs.diff.outputs.isExternalCrates == 'true' && github.event.pull_request.draft == false
if: needs.diff.outputs.isExternalCrates == 'true' && github.event.pull_request.draft == false
needs:
- diff
- dprint-format
- license-check
- typos
uses: ./.github/workflows/_move_ide.yml

hierarchy-complete:
if: (!cancelled() && !failure())
runs-on: [self-hosted]
needs:
- diff
- dprint-format
- license-check
- typos
- docusaurus
- docs-lint
- turborepo
- move-tests
- rust
- e2e
- vercel-deploy
- ledgernano
- move-ide
steps:
- run: echo "Hierarchy Complete"
Loading