Verify #1
This file contains 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: Verify | |
on: | |
workflow_call: | |
workflow_dispatch: | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v3 | |
- name: Install dependencies | |
uses: ./.github/actions/install-dependencies | |
- name: Lint code | |
run: bun format && bun lint:fix | |
- uses: stefanzweifel/git-auto-commit-action@v4 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
commit_message: 'chore: format' | |
commit_user_name: 'github-actions[bot]' | |
commit_user_email: 'github-actions[bot]@users.noreply.github.com' | |
build: | |
name: Build | |
needs: lint | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v3 | |
- name: Install dependencies | |
uses: ./.github/actions/install-dependencies | |
- name: Build | |
run: bun run build | |
types: | |
name: Types | |
needs: lint | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
strategy: | |
matrix: | |
typescript-version: ['5.0.4', 'latest'] | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v3 | |
- name: Install dependencies | |
uses: ./.github/actions/install-dependencies | |
- run: bun i -d typescript@${{ matrix.typescript-version }} | |
- name: Build contracts | |
shell: bash | |
run: bun run contracts:build | |
- name: Check types | |
run: bun run typecheck | |
- name: Test types | |
run: bun run test:typecheck | |
env: | |
VITE_ANVIL_BLOCK_NUMBER: ${{ vars.VITE_ANVIL_BLOCK_NUMBER }} | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 3 | |
matrix: | |
transport-mode: ['http', 'webSocket'] | |
shard: [1, 2, 3] | |
total-shards: [3] | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v3 | |
- name: Install dependencies | |
uses: ./.github/actions/install-dependencies | |
- name: Build contracts | |
shell: bash | |
run: bun run contracts:build | |
- name: Run tests | |
uses: nick-fields/retry@v2 | |
with: | |
timeout_minutes: 10 | |
max_attempts: 3 | |
command: bun run test:ci --shard=${{ matrix.shard }}/${{ matrix.total-shards }} | |
env: | |
VITE_ANVIL_BLOCK_NUMBER: ${{ vars.VITE_ANVIL_BLOCK_NUMBER }} | |
VITE_ANVIL_BLOCK_TIME: ${{ vars.VITE_ANVIL_BLOCK_TIME }} | |
VITE_ANVIL_FORK_URL: ${{ secrets.VITE_ANVIL_FORK_URL }} | |
VITE_BATCH_MULTICALL: ${{ matrix.multicall }} | |
VITE_NETWORK_TRANSPORT_MODE: ${{ matrix.transport-mode }} | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
vectors: | |
name: Vectors | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v3 | |
- name: Install dependencies | |
uses: ./.github/actions/install-dependencies | |
- name: Run test vectors | |
shell: bash | |
run: bun run vectors |