remove unused dependencies axios and yargs #1654
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build, Test | |
on: | |
pull_request: | |
workflow_dispatch: | |
env: | |
MAINNET_RPC: ${{ secrets.MAINNET_RPC }} | |
jobs: | |
install: | |
name: Install on Node.js v${{ matrix.node-version }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18, 20] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install node_modules | |
uses: OffchainLabs/actions/node-modules/install@main | |
with: | |
cache-key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}-monorepo | |
lint: | |
name: Lint on Node.js v${{ matrix.node-version }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18, 20] | |
needs: install | |
permissions: | |
checks: write # https://github.com/mikepenz/action-junit-report/issues/23#issuecomment-1412597753 | |
env: | |
TEST_PATH: /tmp/test-results | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install node_modules | |
uses: OffchainLabs/actions/node-modules/install@main | |
with: | |
cache-key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}-monorepo | |
- name: Lint sdk | |
run: | | |
yarn gen:abi | |
yarn build | |
yarn lint --format junit -o $TEST_PATH/sdk-lint.xml | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: lint-results-${{ github.run_id }}-node-v${{ matrix.node-version }} | |
path: ${{ env.TEST_PATH }} | |
- name: Publish Test Report | |
uses: mikepenz/action-junit-report@v5 | |
if: always() # always run even if the previous step fails | |
with: | |
report_paths: '${{ env.TEST_PATH }}/sdk-lint.xml' | |
fail_on_failure: false | |
audit: | |
name: Audit on Node.js v${{ matrix.node-version }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18, 20] | |
needs: install | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install node_modules | |
uses: OffchainLabs/actions/node-modules/install@main | |
with: | |
cache-key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}-monorepo | |
- run: yarn audit:ci | |
test-unit: | |
name: Test (Unit) on Node.js v${{ matrix.node-version }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18, 20] | |
needs: install | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install node_modules | |
uses: OffchainLabs/actions/node-modules/install@main | |
with: | |
cache-key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}-monorepo | |
- name: Build | |
run: | | |
yarn gen:abi | |
yarn build | |
- name: Run unit tests | |
run: CI=true yarn test:unit | |
test-integration: | |
name: Test (Integration) on Node.js v${{ matrix.node-version }}${{ matrix.orbit-test == '1' && ' with L3' || '' }}${{ matrix.decimals == '16' && ' with custom gas token (16 decimals)' || matrix.decimals == '20' && ' with custom gas token (20 decimals)' || matrix.decimals == '18' && ' with custom gas token (18 decimals)' || '' }} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false # runs all tests to completion even if one fails | |
matrix: | |
include: | |
- orbit-test: '0' | |
node-version: 18 | |
- orbit-test: '0' | |
node-version: 20 | |
- orbit-test: '1' | |
node-version: 18 | |
- orbit-test: '1' | |
node-version: 20 | |
- orbit-test: '1' | |
decimals: 16 | |
node-version: 18 | |
- orbit-test: '1' | |
decimals: 16 | |
node-version: 20 | |
- orbit-test: '1' | |
decimals: 18 | |
node-version: 18 | |
- orbit-test: '1' | |
decimals: 18 | |
node-version: 20 | |
- orbit-test: '1' | |
decimals: 20 | |
node-version: 18 | |
- orbit-test: '1' | |
decimals: 20 | |
node-version: 20 | |
needs: install | |
env: | |
ORBIT_TEST: ${{ matrix.orbit-test }} | |
DECIMALS: ${{ matrix.decimals || '18' }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install node_modules | |
uses: OffchainLabs/actions/node-modules/install@main | |
with: | |
cache-key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}-monorepo | |
- name: Set up the local node | |
uses: OffchainLabs/actions/run-nitro-test-node@main | |
with: | |
nitro-testnode-ref: release | |
l3-node: ${{ matrix.orbit-test == '1' }} | |
args: ${{ matrix.decimals == 16 && '--l3-fee-token --l3-fee-token-decimals 16' || matrix.decimals == 20 && '--l3-fee-token --l3-fee-token-decimals 20' || matrix.decimals == 18 && '--l3-fee-token' || '' }} | |
- name: Copy .env | |
run: cp ./.env-sample ./.env | |
- name: Build | |
run: | | |
yarn gen:abi | |
yarn build | |
- name: Generate network file | |
run: yarn gen:network | |
- name: Run integration tests | |
run: CI=true yarn test:integration |