Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up CI #9

Merged
merged 2 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: "CI"

on:
pull_request:
push:
branches:
- main

env:
FOUNDRY_PROFILE: ci

jobs:
test-unit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Run tests
run: forge test --no-match-path "test/integration/**/*.sol" --fork-url https://mainnet.base.org
env:
FOUNDRY_PROFILE: ci
FORK_TESTS: false

test-integration:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Run tests
run: forge test --match-path "test/integration/**/*.sol"
env:
FOUNDRY_PROFILE: ci
FORK_TESTS: false

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

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Build contracts
run: |
forge --version
forge build --sizes

- name: Check formatting
run: forge fmt --check
env:
FOUNDRY_PROFILE: ci
18 changes: 14 additions & 4 deletions foundry.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
[profile.default]
src = "src"
out = "out"
libs = ["lib"]
src = 'src'
out = 'out'
libs = ['lib']

# See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options
solc_version = "0.8.21"
evm_version = "paris" # to prevent usage of PUSH0, which is not supported on all chains

optimizer = true
optimizer_runs = 500
verbosity = 3


[profile.ci.fuzz]
runs = 1000
max_test_rejects = 1_000_000 # Number of times `vm.assume` can fail
Loading