Skip to content

Merge pull request #25 from frak-id/feature/transfer-all-assets #125

Merge pull request #25 from frak-id/feature/transfer-all-assets

Merge pull request #25 from frak-id/feature/transfer-all-assets #125

Workflow file for this run

name: πŸ§ͺ Foundry tests
on:
push:
branches: ["main"]
workflow_dispatch:
pull_request:
# Cancel previous runs on the same PR
concurrency:
group: ${{ github.ref }}-tests
cancel-in-progress: true
# All the env required for foundry
env:
FOUNDRY_PROFILE: "ci"
API_KEY_ALCHEMY_MAINNET: ${{ secrets.API_KEY_ALCHEMY_MAINNET }}
API_KEY_ALCHEMY_GOERLI: ${{ secrets.API_KEY_ALCHEMY_GOERLI }}
API_KEY_ALCHEMY_POLYGON: ${{ secrets.API_KEY_ALCHEMY_POLYGON }}
API_KEY_ALCHEMY_MUMBAI: ${{ secrets.API_KEY_ALCHEMY_MUMBAI }}
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: 'πŸ”¨ Setup pnpm'
uses: pnpm/action-setup@v2
- name: 'πŸ”¨ Setup Node.js'
id: setup-node
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
- name: 'πŸ”¨ Install dependencies'
run: pnpm install --frozen-lockfile
- name: 'πŸ”¨ Install Foundry'
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: 'πŸ’Ύ Foundry fork cache'
uses: actions/cache@v3
with:
path: "~/.foundry/cache"
key: foundry-${{ hashFiles('foundry.toml') }} # where fork block numbers & RPC are stored
- name: 'πŸ’Ύ Foundry compilation cache'
uses: actions/cache@v3
with:
path: |
cache
out
key: foundry-${{ github.repository_id }}-${{ hashFiles('foundry.toml') }}
- name: '🎨 Run lint tests'
run: forge fmt --check
- name: 'πŸ“¦οΈ Build contracts'
run: forge clean && forge build
- name: 'πŸ§ͺ Run storage tests'
run: pnpm run test:storage
- name: 'πŸ§ͺ Run forge tests'
run: forge test --gas-report > gasreport.ansi
- name: 'πŸ“ˆ Compare gas reports'
uses: Rubilmax/[email protected]
with:
summaryQuantile: 0.9 # only display the 10% most significant gas diffs in the summary (defaults to 20%)
ignore: test/**/*
header: |
# Frak gas diffs
id: gas_diff
- name: 'πŸ“ Add gas diff to sticky comment'
if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target'
uses: marocchino/sticky-pull-request-comment@v2
with:
# delete the comment in case changes no longer impact gas costs
delete: ${{ !steps.gas_diff.outputs.markdown }}
message: ${{ steps.gas_diff.outputs.markdown }}
- name: 'πŸ“ˆ Run snapshot'
run: forge snapshot