Skip to content

Commit

Permalink
Merge pull request #9 from centrifuge/nits
Browse files Browse the repository at this point in the history
Set up CI
  • Loading branch information
hieronx authored Jun 12, 2024
2 parents 0668ba5 + 23fb145 commit 12be13f
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 4 deletions.
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

0 comments on commit 12be13f

Please sign in to comment.