Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into feat-dont-require-w…
Browse files Browse the repository at this point in the history
…allet
  • Loading branch information
fionnachan committed Nov 14, 2024
2 parents a79bf54 + 2722d26 commit 9417a00
Show file tree
Hide file tree
Showing 102 changed files with 2,536 additions and 1,358 deletions.
39 changes: 16 additions & 23 deletions .github/ISSUE_TEMPLATE/add-orbit-chain-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ body:
attributes:
label: Chain description
description: |
A short chain description that will be visible in the networks dropdown. Please make sure this is no longer than 130 characters.
A short chain description that will be visible in the networks dropdown.
placeholder: ex. An amazing chain that does amazing things.
validations:
required: true
required: false
- type: input
id: brand-color
attributes:
Expand All @@ -40,11 +40,13 @@ body:
placeholder: ex. "#FFFFFF"
validations:
required: true
- type: input
- type: textarea
id: chain-logo
attributes:
label: Chain logo
description: Link to the chain logo file.
description: |
Please drag and drop your chain logo image here. Supported formats: PNG, SVG, JPG, JPEG, WEBP. Images larger than 100KB will be resized.
placeholder: Drag and drop your chain logo image here...
validations:
required: true
- type: input
Expand All @@ -63,7 +65,7 @@ body:
- type: dropdown
id: parent-chain-id
attributes:
label: Parent Chain ID
label: Parent chain ID
description: Select the parent chain for your Orbit chain.
options:
- "1"
Expand All @@ -83,7 +85,8 @@ body:
- type: markdown
attributes:
value: |
Fill out this section if you are using a native token other than ETH. If you are using ETH as your gas token you can leave this blank.
Fill out this section if you are using a native token other than ETH.
⚠️ IMPORTANT: If you are using ETH as your gas token you can leave this blank.
- type: input
id: native-token-address
attributes:
Expand All @@ -95,21 +98,23 @@ body:
id: native-token-name
attributes:
label: Native token name
placeholder: ex. Ether
placeholder: ex. My Custom Token
validations:
required: false
- type: input
id: native-token-symbol
attributes:
label: Native token symbol
placeholder: ex. ETH
placeholder: ex. MCT
validations:
required: false
- type: input
- type: textarea
id: native-token-logo
attributes:
label: Native token logo
description: Link to the native token logo file.
description: |
Please drag and drop your native token logo image here. Supported formats: PNG, SVG, JPG, JPEG, WEBP. Images larger than 100KB will be resized.
placeholder: Drag and drop your native token logo image here (skip if using ETH)...
validations:
required: false

Expand Down Expand Up @@ -167,12 +172,6 @@ body:
label: Parent MultiCall
validations:
required: true
- type: input
id: parent-proxy-admin
attributes:
label: Parent Proxy Admin
validations:
required: true
- type: input
id: parent-weth
attributes:
Expand Down Expand Up @@ -212,13 +211,7 @@ body:
- type: input
id: child-multicall
attributes:
label: Child Multicall
validations:
required: true
- type: input
id: child-proxy-admin
attributes:
label: Child Proxy Admin
label: Child MultiCall
validations:
required: true
- type: input
Expand Down
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
56 changes: 55 additions & 1 deletion .github/workflows/add-orbit-chain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ jobs:
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ github.ref_name }}

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
node-version: '20'
cache: 'yarn'

- name: Install node_modules
Expand All @@ -34,8 +35,61 @@ jobs:
- name: Build scripts
run: yarn workspace scripts build

- name: Get issue details
id: issue
uses: actions/github-script@v7
with:
script: |
const issue = await github.rest.issues.get({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: parseInt(process.env.ISSUE_NUMBER)
});
const chainName = issue.data.title.match(/Add Orbit chain\s+(\S+)/i)?.[1] || 'Orbit chain';
return chainName;
result-encoding: string
env:
ISSUE_NUMBER: ${{ inputs.issue_number }}

- name: Generate branch name
id: branch
run: |
timestamp=$(date +%s)
echo "name=feat/add-orbit-chain-${{ inputs.issue_number }}-${timestamp}" >> $GITHUB_OUTPUT
- name: Setup git
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- name: Create branch
run: git checkout -b ${{ steps.branch.outputs.name }}

- name: Run addOrbitChain script
run: yarn workspace scripts add-orbit-chain ../../packages/arb-token-bridge-ui/src/util/orbitChainsData.json
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ISSUE_NUMBER: ${{ github.event.issue.number || inputs.issue_number }}
NEXT_PUBLIC_INFURA_KEY: ${{ secrets.NEXT_PUBLIC_INFURA_KEY }}
NEXT_PUBLIC_INFURA_KEY_HOLESKY: ${{ secrets.NEXT_PUBLIC_INFURA_KEY_HOLESKY }}

- name: Format files
run: yarn prettier --write "packages/arb-token-bridge-ui/src/**/*.{ts,tsx,js,jsx,json}"

- name: Commit changes
run: |
git add packages/arb-token-bridge-ui/src/**/*
git add packages/arb-token-bridge-ui/public/**/*
git status
git commit -m "feat: add ${{ steps.issue.outputs.result }}"
git push origin ${{ steps.branch.outputs.name }}
- name: Create Pull Request
run: |
gh pr create \
--title "feat: add Orbit chain ${{ steps.issue.outputs.result }}" \
--body "Automated pull request to add ${{ steps.issue.outputs.result }} to the bridge. Closes #${{ inputs.issue_number }}" \
--base master \
--head ${{ steps.branch.outputs.name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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 }}
38 changes: 30 additions & 8 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: "Test E2E - ${{ matrix.test.name }}${{ matrix.test.type == 'orbit' && ' with L3' || ''}}"
needs: [load-e2e-files]
name: "Test E2E - ${{ matrix.test.name }} ${{ matrix.test.typeName }}"
needs: [build, load-e2e-files]
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -69,13 +74,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: Install cypress
run: yarn cypress install

- name: Install linux dependencies
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -y \
fluxbox \
xvfb
Expand All @@ -91,15 +97,31 @@ jobs:
if: inputs.test_type != 'cctp'
uses: OffchainLabs/actions/run-nitro-test-node@a20a76172ce524832ac897bef2fa10a62ed81c29
with:
nitro-testnode-ref: aab133aceadec2e622f15fa438f6327e3165392d
l3-node: ${{ matrix.test.type == 'orbit' }}
no-l3-token-bridge: ${{ matrix.test.type != 'orbit' }}
nitro-testnode-ref: badbcbea9b43d46e115da4d7c9f2f57c31af8431
l3-node: ${{ matrix.test.type != 'regular' }}
no-l3-token-bridge: ${{ matrix.test.type == 'regular' }}
args: >-
${{
(matrix.test.type == 'orbit-eth') && '--l3node --l3-token-bridge' ||
(matrix.test.type == 'orbit-custom-6dec' && '--l3-fee-token --l3-fee-token-decimals 6') ||
(matrix.test.type == 'orbit-custom-18dec' && '--l3-fee-token') ||
(matrix.test.type == 'orbit-custom-20dec' && '--l3-fee-token --l3-fee-token-decimals 20') ||
''
}}
- name: Run e2e tests via cypress-io/github-action
uses: cypress-io/github-action@0da3c06ed8217b912deea9d8ee69630baed1737e # [email protected]
with:
start: yarn start
command: "yarn test:e2e${{ (matrix.test.type == 'cctp' && ':cctp') || (matrix.test.type == 'orbit' && ':orbit') || '' }} --browser chrome"
command: >-
${{
(matrix.test.type == 'orbit-eth') && 'yarn test:e2e:orbit --browser chrome' ||
(matrix.test.type == 'orbit-custom-6dec' && 'yarn test:e2e:orbit:custom-gas-token --browser chrome') ||
(matrix.test.type == 'orbit-custom-18dec' && 'yarn test:e2e:orbit:custom-gas-token --browser chrome') ||
(matrix.test.type == 'orbit-custom-20dec' && 'yarn test:e2e:orbit:custom-gas-token --browser chrome') ||
(matrix.test.type == 'cctp' && 'yarn test:e2e:cctp --browser chrome') ||
'yarn test:e2e --browser chrome'
}}
wait-on: http://127.0.0.1:3000
wait-on-timeout: 120
spec: ./packages/arb-token-bridge-ui/tests/e2e/specs/*
Expand All @@ -121,7 +143,7 @@ jobs:
uses: actions/upload-artifact@v4
if: always()
with:
name: e2e-artifacts-${{ github.sha }}-${{ matrix.test.name }}-${{ (matrix.test.type == 'cctp' && 'cctp') || (matrix.test.type == 'orbit' && 'l3') || 'regular'}}
name: e2e-artifacts-${{ github.sha }}-${{ matrix.test.name }}-${{ matrix.test.type }}
path: |
./packages/arb-token-bridge-ui/cypress/videos
./packages/arb-token-bridge-ui/cypress/screenshots
Expand Down
20 changes: 19 additions & 1 deletion .github/workflows/formatSpecfiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,27 @@ switch (testType) {
tests.push({
...spec,
type: "regular",
typeName: "",
});
tests.push({
...spec,
type: "orbit",
type: "orbit-eth",
typeName: "with L3 (ETH)",
});
tests.push({
...spec,
type: "orbit-custom-6dec",
typeName: "with L3 (6 decimals custom)",
});
tests.push({
...spec,
type: "orbit-custom-18dec",
typeName: "with L3 (18 decimals custom)",
});
tests.push({
...spec,
type: "orbit-custom-20dec",
typeName: "with L3 (20 decimals custom)",
});
});
break;
Expand All @@ -23,6 +40,7 @@ switch (testType) {
// Running CCTP tests in parallel cause nonce issues, we're running the two tests sequentially
tests.push({
name: "cctp",
typeName: "",
file: "tests/e2e/specs/**/*Cctp.cy.{js,jsx,ts,tsx}",
recordVideo: false,
type: "cctp",
Expand Down
Loading

0 comments on commit 9417a00

Please sign in to comment.