From 1967893a24c8e7a24f30ace2fe1acda84ab5a9a0 Mon Sep 17 00:00:00 2001 From: Chloe Martin Date: Fri, 10 Jan 2025 08:36:19 -0500 Subject: [PATCH 1/6] chore(CI): Move split cluster check into hierarchy --- .github/workflows/hierarchy.yml | 7 +++++++ .github/workflows/split_cluster.yml | 6 ++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/hierarchy.yml b/.github/workflows/hierarchy.yml index c5def7a8b1b..b8c05918ddf 100644 --- a/.github/workflows/hierarchy.yml +++ b/.github/workflows/hierarchy.yml @@ -170,3 +170,10 @@ jobs: - license-check - typos uses: ./.github/workflows/_move_ide.yml + + split-cluster: + if: (!cancelled() && !failure()) && needs.diff.isRust == 'true' + needs: + - diff + - rust + uses: ./.github/workflows/split_cluster.yml diff --git a/.github/workflows/split_cluster.yml b/.github/workflows/split_cluster.yml index 3c45c361d91..ca7eb2cf3a6 100644 --- a/.github/workflows/split_cluster.yml +++ b/.github/workflows/split_cluster.yml @@ -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 From 5d66f2aa635c62191c72295c67fb5027add1503c Mon Sep 17 00:00:00 2001 From: Chloe Martin Date: Fri, 10 Jan 2025 09:08:38 -0500 Subject: [PATCH 2/6] Split the hierarchy :c --- .../{split_cluster.yml => _split_cluster.yml} | 0 .github/workflows/hierarchy.yml | 64 +--------------- .github/workflows/turbo_hierarchy.yml | 74 +++++++++++++++++++ 3 files changed, 76 insertions(+), 62 deletions(-) rename .github/workflows/{split_cluster.yml => _split_cluster.yml} (100%) create mode 100644 .github/workflows/turbo_hierarchy.yml diff --git a/.github/workflows/split_cluster.yml b/.github/workflows/_split_cluster.yml similarity index 100% rename from .github/workflows/split_cluster.yml rename to .github/workflows/_split_cluster.yml diff --git a/.github/workflows/hierarchy.yml b/.github/workflows/hierarchy.yml index b8c05918ddf..42ee5913e63 100644 --- a/.github/workflows/hierarchy.yml +++ b/.github/workflows/hierarchy.yml @@ -24,19 +24,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')) }} - isWalletDashboard: ${{ (steps.turbo.outputs.packages && contains(fromJson(steps.turbo.outputs.packages), 'wallet-dashboard')) }} - 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 @@ -77,12 +66,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 @@ -119,49 +102,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: - isRust: ${{ needs.diff.outputs.isRust == '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' }} - - vercel-deploy: - if: (!cancelled() && !failure()) - needs: - - diff - - dprint-format - - license-check - - typos - uses: ./.github/workflows/_vercel_deploy.yml - secrets: inherit - with: - shouldDeployPreview: ${{ github.event_name == 'pull_request' && github.event.pull_request.draft == false }} - isExplorer: ${{ needs.diff.outputs.isExplorer == 'true' }} - isTypescriptSDK: ${{ needs.diff.outputs.isTypescriptSDK == 'true' }} - isAppsBackend: ${{ needs.diff.outputs.isAppsBackend == 'true' }} - isAppsUiKit: ${{ needs.diff.outputs.isAppsUiKit == 'true' }} - isWalletDashboard: ${{ needs.diff.outputs.isWalletDashboard == '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: @@ -172,8 +112,8 @@ jobs: uses: ./.github/workflows/_move_ide.yml split-cluster: - if: (!cancelled() && !failure()) && needs.diff.isRust == 'true' + if: (!cancelled() && !failure()) && needs.diff.isRust == 'true' && github.event.pull_request.draft == false needs: - diff - rust - uses: ./.github/workflows/split_cluster.yml + uses: ./.github/workflows/_split_cluster.yml diff --git a/.github/workflows/turbo_hierarchy.yml b/.github/workflows/turbo_hierarchy.yml new file mode 100644 index 00000000000..6017487df4d --- /dev/null +++ b/.github/workflows/turbo_hierarchy.yml @@ -0,0 +1,74 @@ +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: [self-hosted] + concurrency: + group: diff-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }} + outputs: + isRust: ${{ steps.diff.outputs.isRust }} + 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')) }} + isWalletDashboard: ${{ (steps.turbo.outputs.packages && contains(fromJson(steps.turbo.outputs.packages), 'wallet-dashboard')) }} + 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: + isRust: ${{ needs.diff.outputs.isRust == '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' }} + + vercel-deploy: + if: (!cancelled() && !failure()) + needs: + - diff + uses: ./.github/workflows/_vercel_deploy.yml + secrets: inherit + with: + shouldDeployPreview: ${{ github.event_name == 'pull_request' && github.event.pull_request.draft == false }} + isExplorer: ${{ needs.diff.outputs.isExplorer == 'true' }} + isTypescriptSDK: ${{ needs.diff.outputs.isTypescriptSDK == 'true' }} + isAppsBackend: ${{ needs.diff.outputs.isAppsBackend == 'true' }} + isAppsUiKit: ${{ needs.diff.outputs.isAppsUiKit == 'true' }} + isWalletDashboard: ${{ needs.diff.outputs.isWalletDashboard == '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 From 93f3f2274191a64158fc6df9b6f8228e70a49a7b Mon Sep 17 00:00:00 2001 From: Chloe Martin Date: Fri, 10 Jan 2025 09:10:46 -0500 Subject: [PATCH 3/6] fix concurrency --- .github/workflows/turbo_hierarchy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/turbo_hierarchy.yml b/.github/workflows/turbo_hierarchy.yml index 6017487df4d..1b78c109b47 100644 --- a/.github/workflows/turbo_hierarchy.yml +++ b/.github/workflows/turbo_hierarchy.yml @@ -15,7 +15,7 @@ jobs: diff: runs-on: [self-hosted] concurrency: - group: diff-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + group: turbo-diff-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }} outputs: isRust: ${{ steps.diff.outputs.isRust }} From f4e37d3088bb462e031d1834bdb4a76a75952819 Mon Sep 17 00:00:00 2001 From: Chloe Martin Date: Fri, 10 Jan 2025 09:20:56 -0500 Subject: [PATCH 4/6] use github runners for diffs --- .github/workflows/hierarchy.yml | 2 +- .github/workflows/turbo_hierarchy.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/hierarchy.yml b/.github/workflows/hierarchy.yml index 42ee5913e63..fd424e80d5b 100644 --- a/.github/workflows/hierarchy.yml +++ b/.github/workflows/hierarchy.yml @@ -13,7 +13,7 @@ on: jobs: diff: - runs-on: [self-hosted] + runs-on: [ubuntu-latest] concurrency: group: diff-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }} diff --git a/.github/workflows/turbo_hierarchy.yml b/.github/workflows/turbo_hierarchy.yml index 1b78c109b47..f346e9098a2 100644 --- a/.github/workflows/turbo_hierarchy.yml +++ b/.github/workflows/turbo_hierarchy.yml @@ -13,7 +13,7 @@ on: jobs: diff: - runs-on: [self-hosted] + 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' }} From 3f0aca80467b5f699597ab4723b2321c6f916bae Mon Sep 17 00:00:00 2001 From: Chloe Martin Date: Fri, 10 Jan 2025 10:56:00 -0500 Subject: [PATCH 5/6] fix check --- .github/workflows/hierarchy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/hierarchy.yml b/.github/workflows/hierarchy.yml index fd424e80d5b..b87f26b8460 100644 --- a/.github/workflows/hierarchy.yml +++ b/.github/workflows/hierarchy.yml @@ -112,7 +112,7 @@ jobs: uses: ./.github/workflows/_move_ide.yml split-cluster: - if: (!cancelled() && !failure()) && needs.diff.isRust == 'true' && github.event.pull_request.draft == false + if: (!cancelled() && !failure()) && needs.diff.outputs.isRust == 'true' && github.event.pull_request.draft == false needs: - diff - rust From 3e9806965bb34dbdd9a115b5810ff58da5d34f46 Mon Sep 17 00:00:00 2001 From: Chloe Martin Date: Tue, 28 Jan 2025 12:56:48 -0500 Subject: [PATCH 6/6] remove unused var --- .github/workflows/turbo_hierarchy.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/turbo_hierarchy.yml b/.github/workflows/turbo_hierarchy.yml index 7ed755a4682..eea642d664c 100644 --- a/.github/workflows/turbo_hierarchy.yml +++ b/.github/workflows/turbo_hierarchy.yml @@ -23,7 +23,6 @@ jobs: 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: