From d0f15fcecbb6e735ce82b784c2b714efab7b617d Mon Sep 17 00:00:00 2001 From: Fionna <13184582+fionnachan@users.noreply.github.com> Date: Wed, 25 Sep 2024 13:54:09 +0100 Subject: [PATCH 01/16] ci: move out build run --- .github/workflows/build.yml | 42 +++++++++++++++++++ .github/workflows/e2e-tests.yml | 4 +- .github/workflows/run-cctp-tests.yml | 27 ++---------- .../workflows/{build-test.yml => test.yml} | 32 +++----------- 4 files changed, 53 insertions(+), 52 deletions(-) create mode 100644 .github/workflows/build.yml rename .github/workflows/{build-test.yml => test.yml} (74%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000000..af8cf60744 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,42 @@ +name: Build + +on: + pull_request: + branches: ["master"] + types: + - opened + - edited + - synchronize + push: + branches: ["master"] + workflow_dispatch: + merge_group: + +env: + NEXT_PUBLIC_INFURA_KEY: ${{ secrets.NEXT_PUBLIC_INFURA_KEY }} + NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID }} + THE_GRAPH_NETWORK_API_KEY: ${{ secrets.THE_GRAPH_NETWORK_API_KEY }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +jobs: + build: + name: "Build" + runs-on: ubuntu-latest + if: needs.check-files.outputs.run_tests == 'true' && ${{ !contains(github.event.pull_request.title, 'hotfix') }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install node_modules + uses: OffchainLabs/actions/node-modules/install@main + + - name: Build + run: yarn build + env: + NEXT_PUBLIC_IS_E2E_TEST: true + NEXT_PUBLIC_INFURA_KEY: ${{ secrets.NEXT_PUBLIC_INFURA_KEY }} + NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID }} + THE_GRAPH_NETWORK_API_KEY: ${{ secrets.THE_GRAPH_NETWORK_API_KEY }} + + - name: Cache build artifacts + uses: ./.github/actions/build-artifacts/cache diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 00e68cc1d5..08e237e9b4 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -1,6 +1,8 @@ name: E2E tests on: + workflow_run: + workflows: ["Build"] workflow_call: inputs: test_type: @@ -118,4 +120,4 @@ jobs: then gh actions-cache delete build-artifacts-${{ github.run_id }}-${{ github.run_attempt }} --confirm fi - shell: bash \ No newline at end of file + shell: bash diff --git a/.github/workflows/run-cctp-tests.yml b/.github/workflows/run-cctp-tests.yml index f830ce567f..081023d7b1 100644 --- a/.github/workflows/run-cctp-tests.yml +++ b/.github/workflows/run-cctp-tests.yml @@ -1,6 +1,8 @@ name: PR approved workflow on: + workflow_run: + workflows: ["Build"] workflow_dispatch: pull_request_review: types: @@ -49,32 +51,9 @@ jobs: echo "should_run=false" >> $GITHUB_OUTPUT fi - build: - name: "Build" - runs-on: ubuntu-latest - needs: [should-run-tests] - if: needs.should-run-tests.outputs.should_run == 'true' - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install node_modules - uses: OffchainLabs/actions/node-modules/install@main - - - name: Build - run: yarn build - env: - NEXT_PUBLIC_IS_E2E_TEST: true - NEXT_PUBLIC_INFURA_KEY: ${{ secrets.NEXT_PUBLIC_INFURA_KEY }} - NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID }} - THE_GRAPH_NETWORK_API_KEY: ${{ secrets.THE_GRAPH_NETWORK_API_KEY }} - - - name: Cache build artifacts - uses: ./.github/actions/build-artifacts/cache - cctp-e2e-tests: name: "CCTP E2E Tests" - needs: [build, check-files] + needs: [check-files] uses: ./.github/workflows/e2e-tests.yml with: test_type: 'cctp' diff --git a/.github/workflows/build-test.yml b/.github/workflows/test.yml similarity index 74% rename from .github/workflows/build-test.yml rename to .github/workflows/test.yml index 00a3a4f2cd..9fa5f37ce1 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/test.yml @@ -1,6 +1,8 @@ -name: Build, Test +name: Test on: + workflow_run: + workflows: ["Build"] pull_request: branches: ["master"] types: @@ -34,32 +36,10 @@ jobs: - uses: ./.github/actions/check-files id: check-files - build: - name: "Build" - runs-on: ubuntu-latest - if: needs.check-files.outputs.run_tests == 'true' && ${{ !contains(github.event.pull_request.title, 'hotfix') }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install node_modules - uses: OffchainLabs/actions/node-modules/install@main - - - name: Build - run: yarn build - env: - NEXT_PUBLIC_IS_E2E_TEST: true - NEXT_PUBLIC_INFURA_KEY: ${{ secrets.NEXT_PUBLIC_INFURA_KEY }} - NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID }} - THE_GRAPH_NETWORK_API_KEY: ${{ secrets.THE_GRAPH_NETWORK_API_KEY }} - - - name: Cache build artifacts - uses: ./.github/actions/build-artifacts/cache - test-ui: name: "Test UI" runs-on: ubuntu-latest - needs: [build, check-files] + needs: [check-files] if: needs.check-files.outputs.run_tests == 'true' steps: - name: Checkout @@ -77,7 +57,6 @@ jobs: audit: name: "Audit" runs-on: ubuntu-latest - needs: build steps: - name: Checkout uses: actions/checkout@v4 @@ -91,7 +70,6 @@ jobs: check-formatting: name: "Check Formatting" runs-on: ubuntu-latest - needs: build steps: - name: Checkout uses: actions/checkout@v4 @@ -107,7 +85,7 @@ jobs: e2e-tests: name: "E2E Tests" - needs: [build, check-files] + needs: [check-files] uses: ./.github/workflows/e2e-tests.yml with: test_type: 'regular' From 59a87df25cce438fdf778b8d326f4e83577cd9f8 Mon Sep 17 00:00:00 2001 From: Fionna <13184582+fionnachan@users.noreply.github.com> Date: Wed, 25 Sep 2024 14:17:28 +0100 Subject: [PATCH 02/16] try --- .../actions/build-artifacts/cache/action.yml | 32 ++++++++++++++ .github/workflows/build.yml | 42 ------------------- .github/workflows/e2e-tests.yml | 6 +-- .github/workflows/run-cctp-tests.yml | 2 - .github/workflows/test.yml | 6 +-- 5 files changed, 36 insertions(+), 52 deletions(-) delete mode 100644 .github/workflows/build.yml diff --git a/.github/actions/build-artifacts/cache/action.yml b/.github/actions/build-artifacts/cache/action.yml index 985385c5f9..21a2ba206f 100644 --- a/.github/actions/build-artifacts/cache/action.yml +++ b/.github/actions/build-artifacts/cache/action.yml @@ -1,10 +1,42 @@ name: Cache build artifacts description: Cache build artifacts +env: + NEXT_PUBLIC_INFURA_KEY: ${{ secrets.NEXT_PUBLIC_INFURA_KEY }} + NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID }} + THE_GRAPH_NETWORK_API_KEY: ${{ secrets.THE_GRAPH_NETWORK_API_KEY }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + runs: using: composite steps: + - name: Check cache for build artifacts + id: cache + uses: actions/cache/restore@v4 + with: + path: | + ./packages/arb-token-bridge-ui/build + key: build-artifacts-${{ github.run_id }} + + - name: Checkout + uses: actions/checkout@v4 + + - name: Install node_modules + if: steps.cache.outputs.cache-hit != 'true' + uses: OffchainLabs/actions/node-modules/install@main + + run: ${{ inputs.install-command }} + - name: Build + if: steps.cache.outputs.cache-hit != 'true' + run: yarn build + env: + NEXT_PUBLIC_IS_E2E_TEST: true + NEXT_PUBLIC_INFURA_KEY: ${{ secrets.NEXT_PUBLIC_INFURA_KEY }} + NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID }} + THE_GRAPH_NETWORK_API_KEY: ${{ secrets.THE_GRAPH_NETWORK_API_KEY }} + - name: Cache build artifacts + if: steps.cache.outputs.cache-hit != 'true' uses: actions/cache/save@v4 with: path: | diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index af8cf60744..0000000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Build - -on: - pull_request: - branches: ["master"] - types: - - opened - - edited - - synchronize - push: - branches: ["master"] - workflow_dispatch: - merge_group: - -env: - NEXT_PUBLIC_INFURA_KEY: ${{ secrets.NEXT_PUBLIC_INFURA_KEY }} - NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID }} - THE_GRAPH_NETWORK_API_KEY: ${{ secrets.THE_GRAPH_NETWORK_API_KEY }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - -jobs: - build: - name: "Build" - runs-on: ubuntu-latest - if: needs.check-files.outputs.run_tests == 'true' && ${{ !contains(github.event.pull_request.title, 'hotfix') }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install node_modules - uses: OffchainLabs/actions/node-modules/install@main - - - name: Build - run: yarn build - env: - NEXT_PUBLIC_IS_E2E_TEST: true - NEXT_PUBLIC_INFURA_KEY: ${{ secrets.NEXT_PUBLIC_INFURA_KEY }} - NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID }} - THE_GRAPH_NETWORK_API_KEY: ${{ secrets.THE_GRAPH_NETWORK_API_KEY }} - - - name: Cache build artifacts - uses: ./.github/actions/build-artifacts/cache diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 08e237e9b4..0d935edc63 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -1,8 +1,6 @@ name: E2E tests on: - workflow_run: - workflows: ["Build"] workflow_call: inputs: test_type: @@ -44,8 +42,8 @@ jobs: - name: Install node_modules uses: OffchainLabs/actions/node-modules/install@main - - name: Restore build artifacts - uses: ./.github/actions/build-artifacts/restore + - name: Create build or restore build artifacts + uses: ./.github/actions/build-artifacts/cache - name: Install cypress run: yarn cypress install diff --git a/.github/workflows/run-cctp-tests.yml b/.github/workflows/run-cctp-tests.yml index 081023d7b1..da6738d5a9 100644 --- a/.github/workflows/run-cctp-tests.yml +++ b/.github/workflows/run-cctp-tests.yml @@ -1,8 +1,6 @@ name: PR approved workflow on: - workflow_run: - workflows: ["Build"] workflow_dispatch: pull_request_review: types: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9fa5f37ce1..6e0a4e9382 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,8 +1,6 @@ name: Test on: - workflow_run: - workflows: ["Build"] pull_request: branches: ["master"] types: @@ -48,8 +46,8 @@ jobs: - name: Install node_modules uses: OffchainLabs/actions/node-modules/install@main - - name: Restore build artifacts - uses: ./.github/actions/build-artifacts/restore + - name: Create build or restore build artifacts + uses: ./.github/actions/build-artifacts/cache - name: Start UI and Test run: yarn start-server-and-test 'start' http://127.0.0.1:3000 'yarn test:ci' From 42544650740c4425f2b328aad3664ed9d5a8091a Mon Sep 17 00:00:00 2001 From: Fionna <13184582+fionnachan@users.noreply.github.com> Date: Wed, 25 Sep 2024 14:20:53 +0100 Subject: [PATCH 03/16] try --- .github/workflows/e2e-tests.yml | 2 ++ .github/workflows/test.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 0d935edc63..94337406cd 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -44,6 +44,8 @@ jobs: - name: Create build or restore build artifacts uses: ./.github/actions/build-artifacts/cache + with: + secrets: inherit - name: Install cypress run: yarn cypress install diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6e0a4e9382..32cabf4a99 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -48,6 +48,8 @@ jobs: - name: Create build or restore build artifacts uses: ./.github/actions/build-artifacts/cache + with: + secrets: inherit - name: Start UI and Test run: yarn start-server-and-test 'start' http://127.0.0.1:3000 'yarn test:ci' From 18c1b48f9a2d88ebbefc1a7dc57c31580a77e892 Mon Sep 17 00:00:00 2001 From: Fionna <13184582+fionnachan@users.noreply.github.com> Date: Wed, 25 Sep 2024 14:27:51 +0100 Subject: [PATCH 04/16] workflow call --- .../actions/build-artifacts/cache/action.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/actions/build-artifacts/cache/action.yml b/.github/actions/build-artifacts/cache/action.yml index 21a2ba206f..81ada85c48 100644 --- a/.github/actions/build-artifacts/cache/action.yml +++ b/.github/actions/build-artifacts/cache/action.yml @@ -1,6 +1,22 @@ name: Cache build artifacts description: Cache build artifacts +on: + workflow_call: + secrets: + NEXT_PUBLIC_INFURA_KEY: + description: 'Infura key' + required: true + NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID: + description: 'WalletConnect project id' + required: true + THE_GRAPH_NETWORK_API_KEY: + description: 'The Graph network API key' + required: true + GITHUB_TOKEN: + description: 'GitHub token' + required: true + env: NEXT_PUBLIC_INFURA_KEY: ${{ secrets.NEXT_PUBLIC_INFURA_KEY }} NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID }} @@ -8,7 +24,6 @@ env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} runs: - using: composite steps: - name: Check cache for build artifacts id: cache From 2e8c915975c432b1c0f20775885b3e6bea47cfa5 Mon Sep 17 00:00:00 2001 From: Fionna <13184582+fionnachan@users.noreply.github.com> Date: Wed, 25 Sep 2024 14:30:52 +0100 Subject: [PATCH 05/16] try --- .github/actions/build-artifacts/cache/action.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/actions/build-artifacts/cache/action.yml b/.github/actions/build-artifacts/cache/action.yml index 81ada85c48..97576fad95 100644 --- a/.github/actions/build-artifacts/cache/action.yml +++ b/.github/actions/build-artifacts/cache/action.yml @@ -17,12 +17,6 @@ on: description: 'GitHub token' required: true -env: - NEXT_PUBLIC_INFURA_KEY: ${{ secrets.NEXT_PUBLIC_INFURA_KEY }} - NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID }} - THE_GRAPH_NETWORK_API_KEY: ${{ secrets.THE_GRAPH_NETWORK_API_KEY }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - runs: steps: - name: Check cache for build artifacts From 3b5dad6063d9183b84b4c1430373f09444a6ac61 Mon Sep 17 00:00:00 2001 From: Fionna <13184582+fionnachan@users.noreply.github.com> Date: Wed, 25 Sep 2024 14:32:26 +0100 Subject: [PATCH 06/16] update --- .github/actions/build-artifacts/cache/action.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/actions/build-artifacts/cache/action.yml b/.github/actions/build-artifacts/cache/action.yml index 97576fad95..9bb9c34ad2 100644 --- a/.github/actions/build-artifacts/cache/action.yml +++ b/.github/actions/build-artifacts/cache/action.yml @@ -34,7 +34,6 @@ runs: if: steps.cache.outputs.cache-hit != 'true' uses: OffchainLabs/actions/node-modules/install@main - run: ${{ inputs.install-command }} - name: Build if: steps.cache.outputs.cache-hit != 'true' run: yarn build From 4a8b0d3b621b03d6ebbf66aa36295467758bf504 Mon Sep 17 00:00:00 2001 From: Fionna <13184582+fionnachan@users.noreply.github.com> Date: Wed, 25 Sep 2024 14:37:45 +0100 Subject: [PATCH 07/16] try --- .github/actions/build-artifacts/cache/action.yml | 9 +++++++-- .github/workflows/e2e-tests.yml | 2 -- .github/workflows/test.yml | 5 ++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/actions/build-artifacts/cache/action.yml b/.github/actions/build-artifacts/cache/action.yml index 9bb9c34ad2..5f08a00cc7 100644 --- a/.github/actions/build-artifacts/cache/action.yml +++ b/.github/actions/build-artifacts/cache/action.yml @@ -17,8 +17,12 @@ on: description: 'GitHub token' required: true -runs: - steps: +jobs: + check-build-cache: + name: Check cache for build artifacts + runs-on: ubuntu-latest + secrets: inherit + steps: - name: Check cache for build artifacts id: cache uses: actions/cache/restore@v4 @@ -36,6 +40,7 @@ runs: - name: Build if: steps.cache.outputs.cache-hit != 'true' + shell: bash run: yarn build env: NEXT_PUBLIC_IS_E2E_TEST: true diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 94337406cd..0d935edc63 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -44,8 +44,6 @@ jobs: - name: Create build or restore build artifacts uses: ./.github/actions/build-artifacts/cache - with: - secrets: inherit - name: Install cypress run: yarn cypress install diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 32cabf4a99..28ba62b7ef 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -47,10 +47,9 @@ jobs: uses: OffchainLabs/actions/node-modules/install@main - name: Create build or restore build artifacts + uses: ./.github/actions/build-artifacts/cache - with: - secrets: inherit - + - name: Start UI and Test run: yarn start-server-and-test 'start' http://127.0.0.1:3000 'yarn test:ci' From 24902ed5d4a74fed2aea58af5f4b73fe450431c4 Mon Sep 17 00:00:00 2001 From: Fionna <13184582+fionnachan@users.noreply.github.com> Date: Wed, 25 Sep 2024 14:44:36 +0100 Subject: [PATCH 08/16] try --- .../build-artifacts/restore/action.yml | 13 ------------ .../build-artifacts.yml} | 21 ++++++------------- .github/workflows/e2e-tests.yml | 2 +- .github/workflows/test.yml | 3 +-- 4 files changed, 8 insertions(+), 31 deletions(-) delete mode 100644 .github/actions/build-artifacts/restore/action.yml rename .github/{actions/build-artifacts/cache/action.yml => workflows/build-artifacts.yml} (72%) diff --git a/.github/actions/build-artifacts/restore/action.yml b/.github/actions/build-artifacts/restore/action.yml deleted file mode 100644 index 43c73f6462..0000000000 --- a/.github/actions/build-artifacts/restore/action.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: Restore build artifacts -description: Restore build artifacts - -runs: - using: composite - steps: - - name: Restore build artifacts - uses: actions/cache/restore@v4 - with: - path: | - ./packages/arb-token-bridge-ui/build - key: build-artifacts-${{ github.run_id }} - fail-on-cache-miss: true diff --git a/.github/actions/build-artifacts/cache/action.yml b/.github/workflows/build-artifacts.yml similarity index 72% rename from .github/actions/build-artifacts/cache/action.yml rename to .github/workflows/build-artifacts.yml index 5f08a00cc7..162ba2d2f7 100644 --- a/.github/actions/build-artifacts/cache/action.yml +++ b/.github/workflows/build-artifacts.yml @@ -1,27 +1,18 @@ name: Cache build artifacts -description: Cache build artifacts on: workflow_call: - secrets: - NEXT_PUBLIC_INFURA_KEY: - description: 'Infura key' - required: true - NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID: - description: 'WalletConnect project id' - required: true - THE_GRAPH_NETWORK_API_KEY: - description: 'The Graph network API key' - required: true - GITHUB_TOKEN: - description: 'GitHub token' - required: true + +env: + NEXT_PUBLIC_INFURA_KEY: ${{ secrets.NEXT_PUBLIC_INFURA_KEY }} + NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID }} + THE_GRAPH_NETWORK_API_KEY: ${{ secrets.THE_GRAPH_NETWORK_API_KEY }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} jobs: check-build-cache: name: Check cache for build artifacts runs-on: ubuntu-latest - secrets: inherit steps: - name: Check cache for build artifacts id: cache diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 0d935edc63..fa7321f78e 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -43,7 +43,7 @@ jobs: uses: OffchainLabs/actions/node-modules/install@main - name: Create build or restore build artifacts - uses: ./.github/actions/build-artifacts/cache + uses: ./.github/workflows/build-artifacts.yml - name: Install cypress run: yarn cypress install diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 28ba62b7ef..26d57f19bf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -47,8 +47,7 @@ jobs: uses: OffchainLabs/actions/node-modules/install@main - name: Create build or restore build artifacts - - uses: ./.github/actions/build-artifacts/cache + uses: ./.github/workflows/build-artifacts.yml - name: Start UI and Test run: yarn start-server-and-test 'start' http://127.0.0.1:3000 'yarn test:ci' From 8b499a2e6bc28e340f736a6fdb81a361b3d1f6e2 Mon Sep 17 00:00:00 2001 From: Fionna <13184582+fionnachan@users.noreply.github.com> Date: Wed, 25 Sep 2024 14:47:07 +0100 Subject: [PATCH 09/16] file path --- .github/workflows/e2e-tests.yml | 2 +- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index fa7321f78e..cc05879e50 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -43,7 +43,7 @@ jobs: uses: OffchainLabs/actions/node-modules/install@main - name: Create build or restore build artifacts - uses: ./.github/workflows/build-artifacts.yml + uses: ./build-artifacts.yml - name: Install cypress run: yarn cypress install diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 26d57f19bf..c7e2b24a4b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -47,7 +47,7 @@ jobs: uses: OffchainLabs/actions/node-modules/install@main - name: Create build or restore build artifacts - uses: ./.github/workflows/build-artifacts.yml + uses: ./build-artifacts.yml - name: Start UI and Test run: yarn start-server-and-test 'start' http://127.0.0.1:3000 'yarn test:ci' From 148469f575d5b531273fd54c988eb00984d626ff Mon Sep 17 00:00:00 2001 From: Fionna <13184582+fionnachan@users.noreply.github.com> Date: Wed, 25 Sep 2024 14:52:01 +0100 Subject: [PATCH 10/16] :try --- .github/workflows/build-artifacts.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-artifacts.yml b/.github/workflows/build-artifacts.yml index 162ba2d2f7..435ccf8b20 100644 --- a/.github/workflows/build-artifacts.yml +++ b/.github/workflows/build-artifacts.yml @@ -14,6 +14,9 @@ jobs: name: Check cache for build artifacts runs-on: ubuntu-latest steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Check cache for build artifacts id: cache uses: actions/cache/restore@v4 @@ -22,9 +25,6 @@ jobs: ./packages/arb-token-bridge-ui/build key: build-artifacts-${{ github.run_id }} - - name: Checkout - uses: actions/checkout@v4 - - name: Install node_modules if: steps.cache.outputs.cache-hit != 'true' uses: OffchainLabs/actions/node-modules/install@main From 507ea67308e60dcd2387756659799e9b996eded6 Mon Sep 17 00:00:00 2001 From: Fionna <13184582+fionnachan@users.noreply.github.com> Date: Wed, 25 Sep 2024 14:58:04 +0100 Subject: [PATCH 11/16] try --- .github/workflows/e2e-tests.yml | 2 +- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index cc05879e50..fa7321f78e 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -43,7 +43,7 @@ jobs: uses: OffchainLabs/actions/node-modules/install@main - name: Create build or restore build artifacts - uses: ./build-artifacts.yml + uses: ./.github/workflows/build-artifacts.yml - name: Install cypress run: yarn cypress install diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c7e2b24a4b..26d57f19bf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -47,7 +47,7 @@ jobs: uses: OffchainLabs/actions/node-modules/install@main - name: Create build or restore build artifacts - uses: ./build-artifacts.yml + uses: ./.github/workflows/build-artifacts.yml - name: Start UI and Test run: yarn start-server-and-test 'start' http://127.0.0.1:3000 'yarn test:ci' From fba84a92667fea4762409cd88312932b2508cb9a Mon Sep 17 00:00:00 2001 From: Fionna <13184582+fionnachan@users.noreply.github.com> Date: Wed, 25 Sep 2024 15:05:04 +0100 Subject: [PATCH 12/16] rename --- .github/workflows/{build-artifacts.yml => build.yml} | 0 .github/workflows/e2e-tests.yml | 2 +- .github/workflows/test.yml | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename .github/workflows/{build-artifacts.yml => build.yml} (100%) diff --git a/.github/workflows/build-artifacts.yml b/.github/workflows/build.yml similarity index 100% rename from .github/workflows/build-artifacts.yml rename to .github/workflows/build.yml diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index fa7321f78e..899893885f 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -43,7 +43,7 @@ jobs: uses: OffchainLabs/actions/node-modules/install@main - name: Create build or restore build artifacts - uses: ./.github/workflows/build-artifacts.yml + uses: ./.github/workflows/build.yml - name: Install cypress run: yarn cypress install diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 26d57f19bf..3cdba0cdac 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -47,7 +47,7 @@ jobs: uses: OffchainLabs/actions/node-modules/install@main - name: Create build or restore build artifacts - uses: ./.github/workflows/build-artifacts.yml + uses: ./.github/workflows/build.yml - name: Start UI and Test run: yarn start-server-and-test 'start' http://127.0.0.1:3000 'yarn test:ci' From e2fec214afd62c2f6094522f3a6e5cf1f037bbff Mon Sep 17 00:00:00 2001 From: Fionna <13184582+fionnachan@users.noreply.github.com> Date: Wed, 25 Sep 2024 15:08:25 +0100 Subject: [PATCH 13/16] try --- .github/workflows/e2e-tests.yml | 8 +++++--- .github/workflows/test.yml | 9 ++++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 899893885f..6435ab1192 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -27,6 +27,11 @@ jobs: - id: set-matrix run: echo "e2eFiles=$(node .github/workflows/formatSpecfiles.js ${{ inputs.test_type }} | jq . --compact-output)" >> $GITHUB_OUTPUT + build: + name: 'Build' + uses: ./.github/workflows/build.yml + secrets: inherit + test-e2e: name: "Test E2E - ${{ matrix.test.name }}${{ matrix.test.type == 'orbit' && ' with L3' || ''}}" needs: [load-e2e-files] @@ -42,9 +47,6 @@ jobs: - name: Install node_modules uses: OffchainLabs/actions/node-modules/install@main - - name: Create build or restore build artifacts - uses: ./.github/workflows/build.yml - - name: Install cypress run: yarn cypress install diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3cdba0cdac..842682b5fb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,6 +34,12 @@ jobs: - uses: ./.github/actions/check-files id: check-files + build: + name: 'Build' + needs: [check-files] + uses: ./.github/workflows/build.yml + secrets: inherit + test-ui: name: "Test UI" runs-on: ubuntu-latest @@ -46,9 +52,6 @@ jobs: - name: Install node_modules uses: OffchainLabs/actions/node-modules/install@main - - name: Create build or restore build artifacts - uses: ./.github/workflows/build.yml - - name: Start UI and Test run: yarn start-server-and-test 'start' http://127.0.0.1:3000 'yarn test:ci' From 45abb683ac83f9151bc1af9f64f31be12bc59ff8 Mon Sep 17 00:00:00 2001 From: Fionna <13184582+fionnachan@users.noreply.github.com> Date: Wed, 25 Sep 2024 15:09:58 +0100 Subject: [PATCH 14/16] try --- .github/workflows/e2e-tests.yml | 2 +- .github/workflows/test.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 6435ab1192..6b92310141 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -34,7 +34,7 @@ jobs: test-e2e: name: "Test E2E - ${{ matrix.test.name }}${{ matrix.test.type == 'orbit' && ' with L3' || ''}}" - needs: [load-e2e-files] + needs: [build, load-e2e-files] runs-on: ubuntu-latest strategy: fail-fast: false diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 842682b5fb..8cff60eb0f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -43,7 +43,7 @@ jobs: test-ui: name: "Test UI" runs-on: ubuntu-latest - needs: [check-files] + needs: [build, check-files] if: needs.check-files.outputs.run_tests == 'true' steps: - name: Checkout @@ -86,7 +86,7 @@ jobs: e2e-tests: name: "E2E Tests" - needs: [check-files] + needs: [build, check-files] uses: ./.github/workflows/e2e-tests.yml with: test_type: 'regular' From f0c69f62bbdda7faf29b7fe59d1f36e5de206993 Mon Sep 17 00:00:00 2001 From: Fionna <13184582+fionnachan@users.noreply.github.com> Date: Wed, 25 Sep 2024 15:18:28 +0100 Subject: [PATCH 15/16] try --- .github/workflows/test.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8cff60eb0f..847abe8af3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -52,6 +52,13 @@ jobs: - name: Install node_modules uses: OffchainLabs/actions/node-modules/install@main + - name: Restore build artifacts + uses: actions/cache/restore@v4 + with: + path: | + ./packages/arb-token-bridge-ui/build + key: build-artifacts-${{ github.run_id }} + - name: Start UI and Test run: yarn start-server-and-test 'start' http://127.0.0.1:3000 'yarn test:ci' From 1947232214f64c954ac85472fb637aae52aac349 Mon Sep 17 00:00:00 2001 From: Fionna <13184582+fionnachan@users.noreply.github.com> Date: Wed, 25 Sep 2024 15:20:51 +0100 Subject: [PATCH 16/16] try --- .github/actions/restore-build-artifacts/action.yml | 13 +++++++++++++ .github/workflows/e2e-tests.yml | 3 +++ .github/workflows/test.yml | 6 +----- 3 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 .github/actions/restore-build-artifacts/action.yml diff --git a/.github/actions/restore-build-artifacts/action.yml b/.github/actions/restore-build-artifacts/action.yml new file mode 100644 index 0000000000..070f4cdbc6 --- /dev/null +++ b/.github/actions/restore-build-artifacts/action.yml @@ -0,0 +1,13 @@ +name: Restore build artifacts +description: Restore build artifacts + +runs: + using: composite + steps: + - name: Restore build artifacts + uses: actions/cache/restore@v4 + with: + path: | + ./packages/arb-token-bridge-ui/build + key: build-artifacts-${{ github.run_id }} + fail-on-cache-miss: true diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 6b92310141..5bdaecfb78 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -47,6 +47,9 @@ jobs: - name: Install node_modules uses: OffchainLabs/actions/node-modules/install@main + - name: Restore build artifacts + uses: ./.github/actions/restore-build-artifacts + - name: Install cypress run: yarn cypress install diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 847abe8af3..c922d06bbe 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -53,11 +53,7 @@ jobs: uses: OffchainLabs/actions/node-modules/install@main - name: Restore build artifacts - uses: actions/cache/restore@v4 - with: - path: | - ./packages/arb-token-bridge-ui/build - key: build-artifacts-${{ github.run_id }} + uses: ./.github/actions/restore-build-artifacts - name: Start UI and Test run: yarn start-server-and-test 'start' http://127.0.0.1:3000 'yarn test:ci'