set up viem tests #541
Workflow file for this run
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: js-build | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
workflow_dispatch: # Allows manual invocation | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# https://github.com/actions/checkout | |
- name: Checkout | |
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 | |
# Install and cache JS toolchain and dependencies (node_modules) | |
- name: Setup JS | |
uses: ./.github/actions/js-setup | |
- name: Build | |
run: pnpm run build-all | |
- name: Typecheck | |
run: pnpm run typecheck-all | |
# Run Anvil node in background for e2e tests | |
# - name: Anvil | |
# run: | | |
# anvil & | |
- name: Test | |
run: anvil & pnpm run test-all | |
env: # Or as an environment variable | |
API_PUBLIC_KEY: ${{ secrets.API_PUBLIC_KEY }} | |
API_PRIVATE_KEY: ${{ secrets.API_PRIVATE_KEY }} | |
BASE_URL: ${{ secrets.BASE_URL }} | |
ORGANIZATION_ID: ${{ secrets.ORGANIZATION_ID }} | |
PRIVATE_KEY_ID: ${{ secrets.PRIVATE_KEY_ID }} | |
EXPECTED_ETH_ADDRESS: ${{ secrets.EXPECTED_ETH_ADDRESS }} | |
BANNED_TO_ADDRESS: ${{ secrets.BANNED_TO_ADDRESS }} | |
- name: Prettier | |
run: pnpm run prettier-all:check | |
- name: Ensure git is clean | |
run: | | |
if [ -z "$( git status --porcelain )" ]; then | |
echo "Git is clean!" | |
exit 0 | |
else | |
echo "Git is dirty!" | |
git add -A | |
git --no-pager diff HEAD | |
exit 1 | |
fi |