Skip to content

Commit

Permalink
chore: tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm committed Jun 3, 2024
1 parent b6dc49e commit d169790
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 28 deletions.
5 changes: 0 additions & 5 deletions .env.example

This file was deleted.

10 changes: 6 additions & 4 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,13 @@ After the install completes, Bun links packages across the project for developme
First, add the following to your environment (recommended to use [`direnv`](https://github.com/direnv/direnv)):

```bash
VITE_ANVIL_FORK_URL=https://rpc
VITE_ANVIL_BLOCK_TIME=1
VITE_ANVIL_BLOCK_NUMBER=16280770
VITE_ANVIL_FORK_URL=
VITE_ANVIL_FORK_URL_OPTIMISM=
VITE_ANVIL_FORK_URL_OPTIMISM_SEPOLIA=
VITE_ANVIL_FORK_URL_SEPOLIA=
VITE_ANVIL_FORK_URL_ZKSYNC=
VITE_BATCH_MULTICALL=false
VITE_NETWORK_TRANSPORT_MODE=http
VITE_ANVIL_PORT=8545
```

`VITE_ANVIL_FORK_URL` can be for any RPC service provider (e.g. Alchemy or Infura) for the mainnet. Now you are ready to run the tests!
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-rpc-providers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:

- name: Install Playwright Browsers
if: ${{ matrix.runtime == 'next' || matrix.runtime == 'sveltekit' || matrix.runtime == 'vite' }}
run: npx [email protected] install --with-deps
run: pnpx [email protected] install --with-deps

- name: Install dependencies
uses: ./.github/actions/install-dependencies
Expand Down
21 changes: 10 additions & 11 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ jobs:
# If Vitest adds special features in the future, e.g. type coverage, can add this back!
# - name: Test types
# run: pnpm test:typecheck
# env:
# VITE_ANVIL_BLOCK_NUMBER: ${{ vars.VITE_ANVIL_BLOCK_NUMBER }}

test:
name: Test
Expand All @@ -91,6 +89,7 @@ jobs:
strategy:
max-parallel: 3
matrix:
multicall: ['true', 'false']
transport-mode: ['http', 'webSocket']
shard: [1, 2, 3]
total-shards: [3]
Expand All @@ -114,14 +113,11 @@ jobs:
max_attempts: 3
command: pnpm test:ci --shard=${{ matrix.shard }}/${{ matrix.total-shards }}
env:
VITE_ANVIL_BLOCK_NUMBER: ${{ vars.VITE_ANVIL_BLOCK_NUMBER }}
VITE_ANVIL_BLOCK_NUMBER_SEPOLIA: ${{ vars.VITE_ANVIL_BLOCK_NUMBER_SEPOLIA }}
VITE_ANVIL_BLOCK_NUMBER_OPTIMISM_SEPOLIA: ${{ vars.VITE_ANVIL_BLOCK_NUMBER_OPTIMISM_SEPOLIA }}
VITE_ANVIL_BLOCK_TIME: ${{ vars.VITE_ANVIL_BLOCK_TIME }}
VITE_ANVIL_FORK_URL: ${{ secrets.VITE_ANVIL_FORK_URL }}
VITE_ANVIL_FORK_URL_OPTIMISM: ${{ secrets.VITE_ANVIL_FORK_URL_OPTIMISM }}
VITE_ANVIL_FORK_URL_SEPOLIA: ${{ secrets.VITE_ANVIL_FORK_URL_SEPOLIA }}
VITE_ANVIL_FORK_URL_OPTIMISM_SEPOLIA: ${{ secrets.VITE_ANVIL_FORK_URL_OPTIMISM_SEPOLIA }}
VITE_ANVIL_FORK_URL_SEPOLIA: ${{ secrets.VITE_ANVIL_FORK_URL_SEPOLIA }}
VITE_ANVIL_FORK_URL_ZKSYNC: ${{ secrets.VITE_ANVIL_FORK_URL_ZKSYNC }}
VITE_BATCH_MULTICALL: ${{ matrix.multicall }}
VITE_NETWORK_TRANSPORT_MODE: ${{ matrix.transport-mode }}

Expand Down Expand Up @@ -165,6 +161,12 @@ jobs:
with:
submodules: 'recursive'

- name: Set up foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Set up pnpm
uses: wevm/actions/.github/actions/pnpm@main

- name: Set up Bun
if: ${{ matrix.runtime == 'bun' }}
uses: oven-sh/setup-bun@v1
Expand All @@ -179,10 +181,7 @@ jobs:

- 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
run: pnpx [email protected] install --with-deps

- name: Build
run: pnpm build
Expand Down
2 changes: 1 addition & 1 deletion environments/sveltekit/svelte.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const config = {
// If your environment is not supported or you settled on a specific environment, switch out the adapter.
// See https://kit.svelte.dev/docs/adapters for more information about adapters.
adapter: adapter({
runtime: 'nodejs21.x',
runtime: 'nodejs18.x',
}),
},
}
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
"test:ci": "CI=true vitest -c ./test/vitest.config.ts --coverage --retry=3 --bail=1 --pool=forks",
"test:cov": "vitest dev -c ./test/vitest.config.ts --coverage",
"test:env": "pnpm test:env:bun && pnpm test:env:next && pnpm test:env:node && pnpm test:env:vite && pnpm test:env:sveltekit",
"test:env:bun": "cd environments/bun && pnpm test",
"test:env:next": "cd environments/next && pnpm test",
"test:env:node": "cd environments/node && pnpm test",
"test:env:sveltekit": "cd environments/sveltekit && pnpm test",
"test:env:tsc": "cd environments/tsc && pnpm test",
"test:env:vite": "cd environments/vite && pnpm test",
"test:env:bub": "pnpm --filter test-bun test",
"test:env:next": "pnpm --filter test-next test",
"test:env:node": "pnpm --filter test-node test",
"test:env:sveltekit": "pnpm --filter test-sveltekit test",
"test:env:tsc": "pnpm --filter test-tsc test",
"test:env:vite": "pnpm --filter test-vite test",
"test:typecheck": "SKIP_GLOBAL_SETUP=true vitest --typecheck.only -c ./test/vitest.config.ts",
"test:ui": "vitest dev -c ./test/vitest.config.ts --ui",
"typebench": "tsx test/typebench.ts --benchPercentThreshold 10 --benchErrorOnThresholdExceeded",
Expand Down

0 comments on commit d169790

Please sign in to comment.