-
Notifications
You must be signed in to change notification settings - Fork 195
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
ci: move out build run #1926
ci: move out build run #1926
Changes from all commits
d0f15fc
59a87df
4254465
18c1b48
2e8c915
3b5dad6
4a8b0d3
24902ed
8b499a2
148469f
507ea67
fba84a9
e2fec21
45abb68
f0c69f6
1947232
4b04a76
e544337
73f565f
973bb33
aaa4ace
5a83cad
780179e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
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 |
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 }} | ||
Comment on lines
+20
to
+26
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we try to find it from cache first, and if it's not there, then we run build, otherwise just use the cache this is similar to the approach we use for node modules in our actions repo |
||
|
||
- 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 }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
Comment on lines
+30
to
+33
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. moved into here and now the build won't be run twice ever on the same run |
||
|
||
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 | ||
|
@@ -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 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Build, Test | ||
name: Test | ||
|
||
on: | ||
pull_request: | ||
|
@@ -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" | ||
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it never needed the build files |
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
@@ -91,7 +74,6 @@ jobs: | |
check-formatting: | ||
name: "Check Formatting" | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a reusable workflow, not a composite workflow
https://docs.github.com/en/actions/sharing-automations/reusing-workflows