Skip to content

build(deps): bump actions/checkout from 3 to 4 #14

build(deps): bump actions/checkout from 3 to 4

build(deps): bump actions/checkout from 3 to 4 #14

Workflow file for this run

name: Main
on:
pull_request:
push:
# branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
install:
name: Install
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18]
pnpm-version: [7]
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2.2.2
with:
version: ${{ matrix.pnpm-version }}
- name: Set up Node ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
cache: 'pnpm'
node-version: ${{ matrix.node-version }}
- name: Cache pnpm
uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: pnpm-
- name: Cache node_modules
uses: actions/cache@v3
id: cache-node-modules
with:
path: |
node_modules
docs/node_modules
examples/*/node_modules
packages/*/node_modules
packages/**/dist
key: modules-${{ hashFiles('pnpm-lock.yaml') }}
- name: Install Dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: pnpm i
- name: Link Dependencies
if: steps.cache-node-modules.outputs.cache-hit == 'true'
run: pnpm dev
lint:
name: Lint
needs: install
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18]
pnpm-version: [7]
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2.2.2
with:
version: ${{ matrix.pnpm-version }}
- name: Set up Node ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
cache: 'pnpm'
node-version: ${{ matrix.node-version }}
- name: Cache node_modules
uses: actions/cache@v3
with:
path: |
node_modules
docs/node_modules
examples/*/node_modules
packages/*/node_modules
packages/**/dist
key: modules-${{ hashFiles('pnpm-lock.yaml') }}
- name: Lint code
run: pnpm lint
- name: Check types
run: pnpm lint:types
build:
name: Build
needs: lint
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18]
pnpm-version: [7]
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2.2.2
with:
version: ${{ matrix.pnpm-version }}
- name: Set up Node ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
cache: 'pnpm'
node-version: ${{ matrix.node-version }}
- name: Cache node_modules
uses: actions/cache@v3
with:
path: |
node_modules
docs/node_modules
examples/*/node_modules
packages/*/node_modules
packages/**/dist
key: modules-${{ hashFiles('pnpm-lock.yaml') }}
- name: Build
run: pnpm build
test:
name: Test
needs: lint
runs-on: ubuntu-latest
strategy:
matrix:
# TODO: Switch back to Node 16 once Vitest is patched
# https://github.com/vitest-dev/vitest/issues/1191
node-version: [18]
pnpm-version: [7]
react-version: [17, 18]
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2.2.2
with:
version: ${{ matrix.pnpm-version }}
- name: Set up Node ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
cache: 'pnpm'
node-version: ${{ matrix.node-version }}
- name: Cache node_modules
uses: actions/cache@v3
with:
path: |
node_modules
docs/node_modules
examples/*/node_modules
packages/*/node_modules
packages/**/dist
key: modules-${{ hashFiles('pnpm-lock.yaml') }}
- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: wasm32-unknown-unknown
profile: minimal
override: true
- name: Install Anvil
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
# TODO: Cache Anvil RPC calls between runs to speed up tests
- name: Launch Anvil
run: anvil --fork-url $ANVIL_FORK_URL --fork-block-number $ANVIL_BLOCK_NUMBER &
env:
ANVIL_FORK_URL: ${{ secrets.ANVIL_FORK_URL }}
ANVIL_BLOCK_NUMBER: 15132000
- name: Test React 18
if: matrix.react-version == 18
run: pnpm test:coverage
env:
REACT_VERSION: ${{ matrix.react-version }}
- name: Test React 17
if: matrix.react-version == 17
run: |
cd packages/react
pnpm add -D react@17.0.2 react-dom@17.0.2
cd ../..
pnpm test:run react
env:
REACT_VERSION: ${{ matrix.react-version }}