Skip to content

Commit

Permalink
chore(CI): Move split cluster check into hierarchy (#4749)
Browse files Browse the repository at this point in the history
* chore(CI): Move split cluster check into hierarchy

* Split the hierarchy :c

* fix concurrency

* use github runners for diffs

* fix check

* remove unused var

---------

Co-authored-by: Thibault Martinez <[email protected]>
  • Loading branch information
DaughterOfMars and thibault-martinez authored Jan 29, 2025
1 parent b1d8ed3 commit bfca1eb
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ name: Split Cluster Check

on:
workflow_call:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]

concurrency:
group: split-cluster-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }}

env:
CARGO_TERM_COLOR: always
Expand Down
49 changes: 7 additions & 42 deletions .github/workflows/hierarchy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,8 @@ jobs:
isDoc: ${{ steps.diff.outputs.isDoc }}
isReleaseNotesEligible: ${{ steps.diff.outputs.isReleaseNotesEligible }}
isExternalCrates: ${{ steps.diff.outputs.isExternalCrates }}
isWallet: ${{ (steps.turbo.outputs.packages && contains(fromJson(steps.turbo.outputs.packages), 'iota-wallet')) }}
isExplorer: ${{ (steps.turbo.outputs.packages && contains(fromJson(steps.turbo.outputs.packages), 'iota-explorer')) }}
isTypescriptSDK: ${{ (steps.turbo.outputs.packages && contains(fromJson(steps.turbo.outputs.packages), '@iota/iota-sdk')) }}
isAppsBackend: ${{ (steps.turbo.outputs.packages && contains(fromJson(steps.turbo.outputs.packages), 'apps-backend')) }}
isAppsUiKit: ${{ (steps.turbo.outputs.packages && contains(fromJson(steps.turbo.outputs.packages), '@iota/apps-ui-kit')) }}
isGraphQlTransport: ${{ (steps.turbo.outputs.packages && contains(fromJson(steps.turbo.outputs.packages), '@iota/graphql-transport')) }}
isLedgerjs: ${{ (steps.turbo.outputs.packages && contains(fromJson(steps.turbo.outputs.packages), '@iota/ledgerjs-hw-app-iota')) }}
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- name: Detect Changes (turbo)
uses: "./.github/actions/turbo-diffs"
id: turbo
- name: Detect Changes (diff)
uses: "./.github/actions/diffs"
id: diff
Expand Down Expand Up @@ -79,12 +69,6 @@ jobs:
if: (!cancelled() && needs.diff.outputs.isDoc == 'true')
uses: ./.github/workflows/_docs_lint.yml

turborepo:
needs:
- dprint-format
- typos
uses: ./.github/workflows/_turborepo.yml

move-tests:
needs:
- diff
Expand Down Expand Up @@ -122,32 +106,6 @@ jobs:
(needs.diff.outputs.isRosetta == 'true' || needs.diff.outputs.isRust == 'true')
uses: ./.github/workflows/_rosetta.yml

e2e:
if: (!cancelled() && !failure() && !github.event.pull_request.draft && github.ref_name != 'develop')
needs:
- diff
- dprint-format
- license-check
- typos
uses: ./.github/workflows/_e2e.yml
with:
isRpc: ${{ needs.diff.outputs.isRpc == 'true' }}
isWallet: ${{ needs.diff.outputs.isWallet == 'true' }}
isExplorer: ${{ needs.diff.outputs.isExplorer == 'true' }}
isAppsBackend: ${{ needs.diff.outputs.isAppsBackend == 'true' }}
isTypescriptSDK: ${{ needs.diff.outputs.isTypescriptSDK == 'true' }}
isGraphQlTransport: ${{ needs.diff.outputs.isGraphQlTransport == 'true' }}

ledgernano:
if: (!cancelled() && !failure()) && needs.diff.outputs.isLedgerjs == 'true' && github.event.pull_request.draft == false
needs:
- diff
- dprint-format
- license-check
- typos
uses: ./.github/workflows/_ledgernano.yml
secrets: inherit

move-ide:
if: (!cancelled() && !failure()) && needs.diff.outputs.isExternalCrates == 'true' && github.event.pull_request.draft == false
needs:
Expand All @@ -156,3 +114,10 @@ jobs:
- license-check
- typos
uses: ./.github/workflows/_move_ide.yml

split-cluster:
if: (!cancelled() && !failure()) && needs.diff.outputs.isRust == 'true' && github.event.pull_request.draft == false
needs:
- diff
- rust
uses: ./.github/workflows/_split_cluster.yml
58 changes: 58 additions & 0 deletions .github/workflows/turbo_hierarchy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Turborepo Hierarchy

on:
push:
branches:
- "develop"
- "devnet"
- "testnet"
- "mainnet"
- "releases/iota-*-release"
pull_request:
types: [opened, synchronize, reopened, ready_for_review]

jobs:
diff:
runs-on: [ubuntu-latest]
concurrency:
group: turbo-diff-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }}
outputs:
isRpc: ${{ steps.diff.outputs.isRpc }}
isWallet: ${{ (steps.turbo.outputs.packages && contains(fromJson(steps.turbo.outputs.packages), 'iota-wallet')) }}
isExplorer: ${{ (steps.turbo.outputs.packages && contains(fromJson(steps.turbo.outputs.packages), 'iota-explorer')) }}
isTypescriptSDK: ${{ (steps.turbo.outputs.packages && contains(fromJson(steps.turbo.outputs.packages), '@iota/iota-sdk')) }}
isAppsBackend: ${{ (steps.turbo.outputs.packages && contains(fromJson(steps.turbo.outputs.packages), 'apps-backend')) }}
isGraphQlTransport: ${{ (steps.turbo.outputs.packages && contains(fromJson(steps.turbo.outputs.packages), '@iota/graphql-transport')) }}
isLedgerjs: ${{ (steps.turbo.outputs.packages && contains(fromJson(steps.turbo.outputs.packages), '@iota/ledgerjs-hw-app-iota')) }}
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- name: Detect Changes (turbo)
uses: "./.github/actions/turbo-diffs"
id: turbo
- name: Detect Changes (diff)
uses: "./.github/actions/diffs"
id: diff

turborepo:
uses: ./.github/workflows/_turborepo.yml

e2e:
if: (!cancelled() && !failure() && !github.event.pull_request.draft && github.ref_name != 'develop')
needs:
- diff
uses: ./.github/workflows/_e2e.yml
with:
isRpc: ${{ needs.diff.outputs.isRpc == 'true' }}
isWallet: ${{ needs.diff.outputs.isWallet == 'true' }}
isExplorer: ${{ needs.diff.outputs.isExplorer == 'true' }}
isAppsBackend: ${{ needs.diff.outputs.isAppsBackend == 'true' }}
isTypescriptSDK: ${{ needs.diff.outputs.isTypescriptSDK == 'true' }}
isGraphQlTransport: ${{ needs.diff.outputs.isGraphQlTransport == 'true' }}

ledgernano:
if: (!cancelled() && !failure()) && needs.diff.outputs.isLedgerjs == 'true' && github.event.pull_request.draft == false
needs:
- diff
uses: ./.github/workflows/_ledgernano.yml
secrets: inherit

0 comments on commit bfca1eb

Please sign in to comment.