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: Unruggable Gateways CI | |
| on: [push, pull_request_target] | |
| defaults: | |
| run: | |
| working-directory: ./ | |
| jobs: | |
| test: | |
| name: Test v2 on Node ${{ matrix.node }} and ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| node: ['22.x'] | |
| os: [ubuntu-latest] | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha || github.sha }} | |
| - name: Use Bun 1.1.26 | |
| uses: oven-sh/setup-bun@v1 | |
| with: | |
| bun-version: 1.1.26 | |
| - name: Use Node ${{ matrix.node }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node }} | |
| - name: Pull & update submodules recursively | |
| run: | | |
| git submodule update --init --recursive | |
| - name: Install Foundry | |
| uses: foundry-rs/foundry-toolchain@v1.3.1 | |
| - name: Install Dependencies | |
| run: bun install | |
| - name: 'Create env file' | |
| env: | |
| PROVIDER_ORDER_ARB1: ${{ vars.PROVIDER_ORDER_ARB1 }} | |
| PROVIDER_ORDER_BASE: ${{ vars.PROVIDER_ORDER_BASE }} | |
| PROVIDER_ORDER_OP: ${{ vars.PROVIDER_ORDER_OP }} | |
| PROVIDER_ORDER_LINEA: ${{ vars.PROVIDER_ORDER_LINEA }} | |
| PROVIDER_ORDER_SCROLL: ${{ vars.PROVIDER_ORDER_SCROLL }} | |
| run: | | |
| touch .env | |
| echo PROVIDER_ORDER_ARB1=$PROVIDER_ORDER_ARB1 >> .env | |
| echo PROVIDER_ORDER_BASE=$PROVIDER_ORDER_BASE >> .env | |
| echo PROVIDER_ORDER_OP=$PROVIDER_ORDER_OP >> .env | |
| echo PROVIDER_ORDER_LINEA=$PROVIDER_ORDER_LINEA >> .env | |
| echo PROVIDER_ORDER_SCROLL=$PROVIDER_ORDER_SCROLL >> .env | |
| echo ALCHEMY_KEY=${{ secrets.ALCHEMY_KEY }} >> .env | |
| echo INFURA_KEY=${{ secrets.INFURA_KEY }} >> .env | |
| echo DRPC_KEY=${{ secrets.DRPC_KEY }} >> .env | |
| echo IS_CI=true >> .env | |
| cat .env | |
| - name: Build | |
| run: forge build | |
| - name: Test Components (uses node internally) | |
| run: bun run test-components | |
| - name: Test Gateways (uses node internally) | |
| run: | | |
| for test in test/gateway/*.test.ts; do | |
| IS_CI=true bun test "$test" --timeout 50000 | |
| done | |
| lint: | |
| name: Lint v2 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: Use Bun 1.1.26 | |
| uses: oven-sh/setup-bun@v1 | |
| with: | |
| bun-version: 1.1.26 | |
| - name: Install Dependencies | |
| run: bun install | |
| - name: Lint | |
| run: bun run lint | |
| release: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| needs: [test, lint] | |
| if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
| permissions: | |
| contents: write # for tags + GitHub release | |
| issues: write # release notes linked to issues | |
| pull-requests: write # optional | |
| id-token: write # for npm provenance (optional, newer npm) | |
| # GITHUB_TOKEN is provided automatically | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: Use Bun 1.1.26 | |
| uses: oven-sh/setup-bun@v1 | |
| with: | |
| bun-version: 1.1.26 | |
| - name: Use Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22.x | |
| - name: Pull & update submodules recursively | |
| run: | | |
| git submodule update --init --recursive | |
| - name: Install Foundry | |
| uses: foundry-rs/foundry-toolchain@v1.3.1 | |
| - name: Install Dependencies | |
| run: bun install | |
| - name: Build Artifacts | |
| run: bun run build | |
| - name: Do Release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| run: bunx semantic-release |