Skip to content

Verify

Verify #20

Workflow file for this run

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@v4
- name: Install dependencies
uses: ./.github/actions/install-dependencies
- name: Lint code
run: bun format && bun lint:fix
- uses: stefanzweifel/git-auto-commit-action@v5
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@v4
- 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@v4
- 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
timeout-minutes: 10
strategy:
max-parallel: 3
matrix:
transport-mode: ['http', 'webSocket']
shard: [1, 2, 3]
total-shards: [3]
steps:
- name: Clone repository
uses: actions/checkout@v4
- 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 }}
test-envs:
name: Test Environments
runs-on: ubuntu-latest
strategy:
matrix:
type: ['bun', 'node-18', 'node-20', 'node-latest', 'next', 'sveltekit', 'tsc', 'vite']
include:
- type: bun
runtime: bun
- type: node-18
node-version: 18
runtime: node
- type: node-20
node-version: 20
runtime: node
- type: node-latest
node-version: latest
runtime: node
- type: next
runtime: next
- type: sveltekit
node-version: 18
runtime: sveltekit
- type: tsc
node-version: 20
runtime: tsc
- type: vite
runtime: vite
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Set up Bun
if: ${{ matrix.runtime == 'bun' }}
uses: oven-sh/setup-bun@v1
- name: Set up Node
if: ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install Playwright Browsers
if: ${{ matrix.runtime == 'next' || matrix.runtime == 'sveltekit' || matrix.runtime == 'vite' }}
run: npx [email protected] install --with-deps
- name: Install dependencies
uses: ./.github/actions/install-dependencies
- name: Build
run: bun run build
- name: Link
run: bun install
- name: Run tests
run: bun run test:env:${{ matrix.runtime }}
vectors:
name: Vectors
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Install dependencies
uses: ./.github/actions/install-dependencies
- name: Run test vectors
shell: bash
run: bun run vectors
wagmi:
name: Wagmi Types
runs-on: ubuntu-latest
strategy:
matrix:
typescript-version: ['5.0.4', '5.1.6', '5.2.2', 'latest']
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Install dependencies
uses: ./.github/actions/install-dependencies
- name: Build and link viem
run: bun run build && pnpm link --global
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v4
with:
cache: pnpm
node-version: 20
- run: gh repo clone wevm/wagmi
- name: Set up wagmi
run: |
pnpm install
pnpm link --global viem
pnpm add -D -w typescript@${{ matrix.typescript-version }}
# pnpm preconstruct
working-directory: ./wagmi
- name: Check types
run: pnpm typecheck
working-directory: ./wagmi
- name: Check build
run: pnpm build
working-directory: ./wagmi