167 lines
4.6 KiB
YAML
167 lines
4.6 KiB
YAML
name: Verify
|
|
on:
|
|
workflow_call:
|
|
workflow_dispatch:
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
check:
|
|
name: Check
|
|
permissions:
|
|
contents: write
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 5
|
|
|
|
steps:
|
|
- name: Clone repository
|
|
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
|
|
with:
|
|
token: ${{ secrets.GH_PTOKEN }}
|
|
|
|
- name: Install dependencies
|
|
uses: wevm/actions/.github/actions/pnpm@f7ad7f00e16e73322562922c241f21f0c7ffbbec
|
|
with:
|
|
node-version: 24.5
|
|
|
|
- name: Audit dependencies
|
|
run: pnpm audit
|
|
|
|
- name: Check repo
|
|
run: pnpm check:repo
|
|
|
|
- name: Check code
|
|
run: pnpm check
|
|
|
|
- name: Update package versions
|
|
run: pnpm version:update
|
|
|
|
- uses: stefanzweifel/git-auto-commit-action@778341af668090896ca464160c2def5d1d1a3eb0 # v6.0.1
|
|
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
|
|
permissions:
|
|
contents: read
|
|
needs: check
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 5
|
|
|
|
steps:
|
|
- name: Clone repository
|
|
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
|
|
|
|
- name: Install dependencies
|
|
uses: wevm/actions/.github/actions/pnpm@f7ad7f00e16e73322562922c241f21f0c7ffbbec
|
|
with:
|
|
node-version: 24.5
|
|
|
|
- name: Build
|
|
run: pnpm clean && pnpm build
|
|
|
|
- name: Publint
|
|
run: pnpm test:build
|
|
|
|
- name: Check for unused files, dependencies, and exports
|
|
run: pnpm knip --production
|
|
|
|
types:
|
|
name: Types
|
|
permissions:
|
|
contents: read
|
|
needs: check
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 5
|
|
strategy:
|
|
matrix:
|
|
typescript-version: ['5.7.3', '5.8.3', '5.9.3', 'latest']
|
|
viem-version: ['2.46.0', 'latest']
|
|
|
|
steps:
|
|
- name: Clone repository
|
|
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
|
|
|
|
- name: Install dependencies
|
|
uses: wevm/actions/.github/actions/pnpm@f7ad7f00e16e73322562922c241f21f0c7ffbbec
|
|
with:
|
|
node-version: 24.5
|
|
|
|
- run: pnpm add -D -w typescript@${{ matrix.typescript-version }} viem@${{ matrix.viem-version }}
|
|
|
|
- name: Link packages
|
|
run: pnpm preconstruct
|
|
|
|
- name: Check types
|
|
run: pnpm check:types
|
|
|
|
- name: Bench types
|
|
run: pnpm bench:types
|
|
|
|
# Redundant with `pnpm check:types`
|
|
# If Vitest adds special features in the future, e.g. type coverage, can add this back!
|
|
# - name: Test types
|
|
# run: pnpm test:typecheck
|
|
|
|
test:
|
|
name: Test
|
|
permissions:
|
|
contents: read
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 20
|
|
strategy:
|
|
max-parallel: 4
|
|
matrix:
|
|
shard: [1, 2, 3, 4]
|
|
total-shards: [4]
|
|
|
|
steps:
|
|
- name: Clone repository
|
|
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
|
|
|
|
- name: Install dependencies
|
|
uses: wevm/actions/.github/actions/pnpm@f7ad7f00e16e73322562922c241f21f0c7ffbbec
|
|
with:
|
|
node-version: 24.5
|
|
|
|
- name: Setup Docker
|
|
uses: docker/setup-docker-action@v4
|
|
|
|
- name: Set up foundry
|
|
uses: foundry-rs/foundry-toolchain@50d5a8956f2e319df19e6b57539d7e2acb9f8c1e # v1.5.0
|
|
with:
|
|
version: nightly
|
|
|
|
- name: Cache Playwright
|
|
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb
|
|
id: playwright-cache
|
|
with:
|
|
path: ~/.cache/ms-playwright
|
|
key: ${{ runner.os }}-playwright-${{ hashFiles('pnpm-lock.yaml') }}
|
|
|
|
- name: Install Playwright
|
|
if: steps.playwright-cache.outputs.cache-hit != 'true'
|
|
run: pnpm exec playwright install chromium --with-deps
|
|
|
|
- name: Pull Tempo Docker image
|
|
run: docker pull ghcr.io/tempoxyz/tempo:latest
|
|
|
|
- name: Run tests
|
|
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08
|
|
with:
|
|
command: CI=true pnpm test:cov --shard=${{ matrix.shard }}/${{ matrix.total-shards }} --retry=3 --bail=1
|
|
max_attempts: 3
|
|
timeout_minutes: 5
|
|
env:
|
|
VITE_MAINNET_FORK_URL: ${{ secrets.VITE_MAINNET_FORK_URL }}
|
|
VITE_OPTIMISM_FORK_URL: ${{ secrets.VITE_OPTIMISM_FORK_URL }}
|
|
|
|
- name: Upload coverage reports to Codecov
|
|
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|