Merge branch 'staging' into main #1
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
# This workflow runs the CI command defined in package.json | |
name: CI | |
env: | |
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
ci: | |
name: CI | |
runs-on: ubuntu-latest | |
env: | |
PRIVATE_ALCHEMY_ID: ${{ secrets.PRIVATE_ALCHEMY_ID }} | |
ANVIL_BLOCK_NUMBER: 16522514 | |
ANVIL_FORK_URL: https://eth-mainnet.alchemyapi.io/v2/${{ secrets.PRIVATE_ALCHEMY_ID }} | |
steps: | |
- name: ⬇️ Checkout repo | |
uses: actions/checkout@v3 | |
- name: 📦 Install pnpm | |
uses: pnpm/[email protected] | |
with: | |
version: 8.15 | |
- name: 📦 Setup Node 18 | |
uses: actions/setup-node@v3 | |
with: | |
cache: 'pnpm' | |
node-version: 18 | |
- name: 💾 Cache node_modules | |
uses: actions/cache@v3 | |
id: cache-node-modules | |
with: | |
path: | | |
node_modules | |
apps/**/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: 💾 Cache Anvil | |
uses: 'actions/cache@v3' | |
with: | |
path: ~/.foundry/cache/rpc/**/${{ env.ANVIL_BLOCK_NUMBER }} | |
key: foundry-anvil-${{ env.ANVIL_BLOCK_NUMBER }} | |
- name: 👾 Run lint task | |
run: pnpm lint | |
- name: 👾 Run type check task | |
run: pnpm type-check | |
- 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 | |
- name: 🚀 Launch Anvil | |
run: anvil --fork-url $ANVIL_FORK_URL --fork-block-number $ANVIL_BLOCK_NUMBER & | |
- name: 👾 Run test task | |
run: pnpm test | |
# Need to shutdown Anvil so cache gets created | |
- name: 💤 Shutdown Anvil | |
run: pkill -2 anvil | |
# TODO @0xMillz for production: (https://vercel.com/guides/how-can-i-use-github-actions-with-vercel) | |
# - uses: actions/checkout@v2 | |
# - name: Install Vercel CLI | |
# run: npm install --global vercel@latest | |
# - name: Pull Vercel Environment Information | |
# run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} | |
# - name: Build Project Artifacts | |
# run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }} | |
# - name: Deploy Project Artifacts to Vercel | |
# run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }} |