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

Test: init testing setup #2

Merged
merged 7 commits into from
May 2, 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
116 changes: 85 additions & 31 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,88 @@
name: test
name: ci

on: workflow_dispatch

env:
FOUNDRY_PROFILE: ci
on:
push:
branches:
- main
pull_request:

jobs:
check:
strategy:
fail-fast: true

name: Foundry project
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

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

- name: Run Forge build
run: |
forge --version
forge build --sizes
id: build

- name: Run Forge tests
run: |
forge test -vvv
id: test
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Install foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Run foundry build
run: |
forge --version
forge build
id: build

lint-check:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Run foundry fmt check
run: |
forge fmt --check
id: fmt

test:
runs-on: ubuntu-latest
needs: lint-check
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Run foundry tests
# --ast tests enables inline configs to work https://github.com/foundry-rs/foundry/issues/7310#issuecomment-1978088200
run: |
forge test -vv --gas-report --ast
id: test

fuzz:
runs-on: ubuntu-latest
needs: lint-check
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Run foundry tests
run: |
FOUNDRY_PROFILE=ci_fuzz forge test -vv
id: fuzz

# coverage:
# runs-on: ubuntu-latest
# needs: lint-check
# steps:
# - uses: actions/checkout@v3
# with:
# submodules: recursive
# - uses: foundry-rs/foundry-toolchain@v1
# with:
# version: nightly
# - name: Run foundry coverage
# run: |
# FOUNDRY_PROFILE=coverage forge coverage --report summary
# id: coverage
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
[submodule "lib/ethereum-vault-connector"]
path = lib/ethereum-vault-connector
url = https://github.com/euler-xyz/ethereum-vault-connector
[submodule "lib/euler-vault-kit"]
path = lib/euler-vault-kit
url = https://github.com/euler-xyz/euler-vault-kit
59 changes: 59 additions & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,64 @@
src = "src"
out = "out"
libs = ["lib"]
test = 'test'
optimizer = true
optimizer_runs = 20_000
solc = "0.8.23"
gas_reports = ["*"]
fs_permissions = [{ access = "read", path = "./"}]

[profile.default.fmt]
line_length = 120
tab_width = 4
bracket_spacing = false
int_types = "long"
quote_style = "double"
number_underscore = "preserve"
override_spacing = true

[profile.fuzz]
runs = 1000
max_local_rejects = 1024
max_global_rejects = 65536
seed = '0x3e8'
dictionary_weight = 100
include_storage = true
include_push_bytes = true
match_test = "Fuzzing"
match_contract = "Fuzzing"

[profile.ci_fuzz]
runs = 50000
max_local_rejects = 1024
max_global_rejects = 65536
seed = '0x3e8'
dictionary_weight = 100
include_storage = true
include_push_bytes = true
match_test = "Fuzzing"
match_contract = "Fuzzing"

[profile.invariant]
runs = 256
depth = 15
fail_on_revert = false
call_override = false
dictionary_weight = 80
include_storage = true
include_push_bytes = true

[profile.coverage]
via_ir = true
no_match_test = "Fuzzing"
no_match_contract = "Script"

[profile.coverage.optimizer_details]
constantOptimizer = true
yul = true

[profile.coverage.optimizer_details.yulDetails]
stackAllocation = true
optimizerSteps = ''

# See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options
1 change: 1 addition & 0 deletions lib/euler-vault-kit
Submodule euler-vault-kit added at e75770
1 change: 1 addition & 0 deletions remappings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ ethereum-vault-connector/=lib/ethereum-vault-connector/src/
forge-std/=lib/forge-std/src/
openzeppelin-contracts/=lib/ethereum-vault-connector/lib/openzeppelin-contracts/contracts/
openzeppelin/=lib/ethereum-vault-connector/lib/openzeppelin-contracts/contracts/
evk/=lib/euler-vault-kit/
14 changes: 0 additions & 14 deletions src/Counter.sol

This file was deleted.

Loading
Loading