Skip to content

Commit

Permalink
* Added a ci job that checks for contract size
Browse files Browse the repository at this point in the history
* Caching foundry build for different test tasks
* Combined test and coverage into single workflow file
  • Loading branch information
oveddan committed Aug 11, 2023
1 parent 8714a06 commit d71719f
Show file tree
Hide file tree
Showing 5 changed files with 138 additions and 109 deletions.
19 changes: 19 additions & 0 deletions .github/actions/setup_deps/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: 'Setup Node and Foundry'
description: 'Setups up node and foundry'
runs:
using: "composite"
steps:
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16
cache: "yarn"

- name: Install project dependencies
shell: bash
run: yarn

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
119 changes: 119 additions & 0 deletions .github/workflows/foundry.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
name: Foundry

on: push

jobs:
build:
name: Build and cache
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install node deps and founry
uses: ./.github/actions/setup_deps

- name: Build contracts
run: |
forge build
- name: Archive built artifacts
uses: actions/upload-artifact@v3
with:
name: foundry-built-artifacts
path: |
cache
out
retention-days: 1

contract_size_check:
needs: build
strategy:
fail-fast: true

name: Contract Size Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install node deps and founry
uses: ./.github/actions/setup_deps

- name: Download foundry artifacts
uses: actions/download-artifact@v3
with:
name: foundry-built-artifacts

- name: Check contract sizes
run: |
forge build --sizes
test:
needs: build
strategy:
fail-fast: true

name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install node deps and founry
uses: ./.github/actions/setup_deps

- name: Download foundry artifacts
uses: actions/download-artifact@v3
with:
name: foundry-built-artifacts

- name: Run Forge tests
run: |
forge test -vvv
test_fork:
needs: build
strategy:
fail-fast: true

name: Fork Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install node deps and founry
uses: ./.github/actions/setup_deps

- name: Download foundry artifacts
uses: actions/download-artifact@v3
with:
name: foundry-built-artifacts

- name: Run fork tests
run: |
forge test -vvv --match-test fork
env:
FORK_TEST_CHAINS: mainnet,goerli,optimism,optimism_goerli,zora,zora_goerli,base_goerli,base,pgn_sepolia,pgn
ALCHEMY_KEY: ${{ secrets.ALCHEMY_KEY }}

storage_layout:
needs: build
strategy:
fail-fast: true

name: Inpect storage layout
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install node deps and founry
uses: ./.github/actions/setup_deps

- name: Download foundry artifacts
uses: actions/download-artifact@v3
with:
name: foundry-built-artifacts

- name: "Inspect Storage Layout"
continue-on-error: false
run: |
forge build
yarn run storage-inspect:check
29 changes: 0 additions & 29 deletions .github/workflows/storage.yml

This file was deleted.

39 changes: 0 additions & 39 deletions .github/workflows/test.yml

This file was deleted.

41 changes: 0 additions & 41 deletions .github/workflows/test_fork.yml

This file was deleted.

0 comments on commit d71719f

Please sign in to comment.