Skip to content

Commit

Permalink
Merge branch 'master' into dl/fs-940
Browse files Browse the repository at this point in the history
  • Loading branch information
fionnachan authored Oct 22, 2024
2 parents 4540064 + 2e1e23c commit 09bb032
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 73 deletions.
12 changes: 0 additions & 12 deletions .github/actions/build-artifacts/cache/action.yml

This file was deleted.

13 changes: 0 additions & 13 deletions .github/actions/build-artifacts/restore/action.yml

This file was deleted.

13 changes: 13 additions & 0 deletions .github/actions/restore-build-artifacts/action.yml
Original file line number Diff line number Diff line change
@@ -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
48 changes: 48 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Cache build artifacts

on:
workflow_call:

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
steps:
- name: Checkout
uses: actions/checkout@v4

- 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: Install node_modules
if: steps.cache.outputs.cache-hit != 'true'
uses: OffchainLabs/actions/node-modules/install@main

- name: Build
if: steps.cache.outputs.cache-hit != 'true'
shell: bash
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: |
./packages/arb-token-bridge-ui/build
key: build-artifacts-${{ github.run_id }}
9 changes: 7 additions & 2 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,14 @@ 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: "${{ matrix.test.name }}${{ matrix.test.type == 'orbit-eth' && ' with L3' || matrix.test.type == 'orbit-custom' && ' with custom fee token' || ''}}"
needs: [load-e2e-files]
needs: [build, load-e2e-files]
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -69,7 +74,7 @@ jobs:
uses: OffchainLabs/actions/node-modules/install@main

- name: Restore build artifacts
uses: ./.github/actions/build-artifacts/restore
uses: ./.github/actions/restore-build-artifacts

- name: Install cypress
run: yarn cypress install
Expand Down
22 changes: 0 additions & 22 deletions .github/workflows/run-cctp-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,8 @@ env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
build:
name: "Build"
runs-on: ubuntu-latest
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]
uses: ./.github/workflows/e2e-tests.yml
with:
test_type: 'cctp'
Expand Down
30 changes: 6 additions & 24 deletions .github/workflows/build-test.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build, Test
name: Test

on:
pull_request:
Expand Down Expand Up @@ -35,26 +35,10 @@ jobs:
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
name: 'Build'
needs: [check-files]
uses: ./.github/workflows/build.yml
secrets: inherit

test-ui:
name: "Test UI"
Expand All @@ -69,15 +53,14 @@ jobs:
uses: OffchainLabs/actions/node-modules/install@main

- name: Restore build artifacts
uses: ./.github/actions/build-artifacts/restore
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'

audit:
name: "Audit"
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -91,7 +74,6 @@ jobs:
check-formatting:
name: "Check Formatting"
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down

0 comments on commit 09bb032

Please sign in to comment.