Skip to content

build(deps): bump the examples group across 12 directories with 3 updates #2753

build(deps): bump the examples group across 12 directories with 3 updates

build(deps): bump the examples group across 12 directories with 3 updates #2753

Workflow file for this run

name: Build, Test
on:
pull_request:
workflow_dispatch:
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
audit:
name: 'Audit'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10.30.3
run_install: false
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Install node_modules
uses: OffchainLabs/actions/node-modules/install@main
with:
install-command: pnpm install --frozen-lockfile
cache-key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
- name: Run audit
run: pnpm audit:ci
check-formatting:
name: 'Check Formatting'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10.30.3
run_install: false
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Install node_modules
uses: OffchainLabs/actions/node-modules/install@main
with:
install-command: pnpm install --frozen-lockfile
cache-key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
- name: Check formatting with Prettier
run: pnpm prettier:check
check-linting:
name: 'Check Linting'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10.30.3
run_install: false
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Install node_modules
uses: OffchainLabs/actions/node-modules/install@main
with:
install-command: pnpm install --frozen-lockfile
cache-key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
- name: Check linting
run: pnpm lint
test-type:
name: Test (Type)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10.30.3
run_install: false
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Install node_modules
uses: OffchainLabs/actions/node-modules/install@main
with:
install-command: pnpm install --frozen-lockfile
cache-key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
- name: Copy .env
run: cp ./.env.example ./.env
- name: Build
run: pnpm build
- name: Test
run: pnpm test:type
test-unit:
name: Test (Unit)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10.30.3
run_install: false
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Install node_modules
uses: OffchainLabs/actions/node-modules/install@main
with:
install-command: pnpm install --frozen-lockfile
cache-key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
- name: Copy .env
run: cp ./.env.example ./.env
- name: Build
run: pnpm build
- name: Test
run: pnpm test:unit
test-integration:
name: Test (Integration) - ${{ matrix.config.name }}
runs-on: ubuntu-latest
strategy:
matrix:
config:
- name: Nitro contracts v3.2 - Custom gas token with 18 decimals
nitro-contracts-branch: v3.2.0
args: --tokenbridge --l3node --l3-token-bridge --l3-fee-token
decimals: 18
- name: Nitro contracts v3.2 - Custom gas token with 6 decimals
nitro-contracts-branch: v3.2.0
args: --tokenbridge --l3node --l3-token-bridge --l3-fee-token --l3-fee-token-decimals 6
decimals: 6
- name: Nitro contracts v2.1 - Custom gas token with 18 decimals
nitro-contracts-branch: v2.1.3
args: --tokenbridge --l3node --l3-token-bridge --l3-fee-token
decimals: 18
- name: Nitro contracts v2.1 - Custom gas token with 6 decimals
nitro-contracts-branch: v2.1.3
args: --tokenbridge --l3node --l3-token-bridge --l3-fee-token --l3-fee-token-decimals 6
decimals: 6
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10.30.3
run_install: false
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Install node_modules
uses: OffchainLabs/actions/node-modules/install@main
with:
install-command: pnpm install --frozen-lockfile
cache-key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
- name: Set up the local node
uses: OffchainLabs/actions/run-nitro-test-node@feat-simplify
with:
nitro-testnode-ref: release
nitro-contracts-branch: ${{ matrix.config.nitro-contracts-branch }}
args: ${{ matrix.config.args }}
- name: Copy .env
run: cp ./.env.example ./.env
- name: Build
run: pnpm build
- name: Test
run: |
INTEGRATION_TEST_DECIMALS=${{matrix.config.decimals}} \
INTEGRATION_TEST_NITRO_CONTRACTS_BRANCH=${{matrix.config.nitro-contracts-branch}} \
pnpm test:integration
test-integration-arbitrum-testnode:
name: Test (Integration) - Arbitrum Testnode - ${{ matrix.config.name }}
runs-on: ubuntu-latest
permissions:
contents: read
packages: read
strategy:
matrix:
config:
- name: Nitro contracts v3.2 - Custom gas token with 18 decimals
image: ghcr.io/offchainlabs/arbitrum-testnode-ci:v0.2.10-nc3.2-l3-custom-18
variant: l3-custom-18
container: arbitrum-testnode-v3-2-l3-custom-18
nitro-contracts-version: v3.2
decimals: 18
- name: Nitro contracts v3.2 - Custom gas token with 6 decimals
image: ghcr.io/offchainlabs/arbitrum-testnode-ci:v0.2.10-nc3.2-l3-custom-6
variant: l3-custom-6
container: arbitrum-testnode-v3-2-l3-custom-6
nitro-contracts-version: v3.2
decimals: 6
- name: Nitro contracts v2.1 - Custom gas token with 18 decimals
image: ghcr.io/offchainlabs/arbitrum-testnode-ci:v0.2.10-nc2.1-l3-custom-18
variant: l3-custom-18
container: arbitrum-testnode-v2-1-l3-custom-18
nitro-contracts-version: v2.1
decimals: 18
- name: Nitro contracts v2.1 - Custom gas token with 6 decimals
image: ghcr.io/offchainlabs/arbitrum-testnode-ci:v0.2.10-nc2.1-l3-custom-6
variant: l3-custom-6
container: arbitrum-testnode-v2-1-l3-custom-6
nitro-contracts-version: v2.1
decimals: 6
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10.30.3
run_install: false
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Install node_modules
uses: OffchainLabs/actions/node-modules/install@main
with:
install-command: pnpm install --frozen-lockfile
cache-key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build token bridge contracts image
uses: docker/build-push-action@v6
with:
context: token-bridge-contracts
load: true
tags: arbitrum-chain-sdk-token-bridge-contracts:v1.2.2
cache-from: type=gha,scope=token-bridge-contracts-v1.2.2
cache-to: type=gha,mode=max,scope=token-bridge-contracts-v1.2.2
- name: Set up the local node
run: |
docker pull "${{ matrix.config.image }}"
docker run -d \
--name "${{ matrix.config.container }}" \
--platform linux/amd64 \
-e TESTNODE_VARIANT="${{ matrix.config.variant }}" \
-p 127.0.0.1:8545:8545 \
-p 127.0.0.1:8547:8547 \
-p 127.0.0.1:8548:8548 \
-p 127.0.0.1:3347:8549 \
-p 127.0.0.1:3348:8550 \
-p 127.0.0.1:8080:8080 \
"${{ matrix.config.image }}"
deadline=$((SECONDS + 120))
until curl -sf http://127.0.0.1:8080/health >/dev/null; do
if (( SECONDS >= deadline )); then
docker logs "${{ matrix.config.container }}" >&2 || true
echo "arbitrum-testnode did not become healthy within 120s" >&2
exit 1
fi
sleep 1
done
- name: Copy .env
run: cp ./.env.example ./.env
- name: Build
run: pnpm build
- name: Test
run: |
ARBITRUM_TESTNODE_CONTAINER=${{ matrix.config.container }} \
INTEGRATION_TEST_DECIMALS=${{ matrix.config.decimals }} \
INTEGRATION_TEST_NITRO_CONTRACTS_BRANCH=${{ matrix.config.nitro-contracts-version }} \
NITRO_TESTNODE_L3_TOKEN_BRIDGE_DEPLOYER_PRIVATE_KEY=0x84f89f9afcf4cd87bbf0a8872a1abd8ddf69364da61a2c2a5286d999383cd2c9 \
TOKEN_BRIDGE_CONTRACTS_SKIP_BUILD=true \
CI=true \
pnpm test:integration