Skip to content

Commit

Permalink
feat: git fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
deluca-mike committed Jan 3, 2025
1 parent db0742a commit 6b57c30
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 36 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/test-fuzz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@
# - name: Install Foundry
# uses: foundry-rs/foundry-toolchain@v1
#
# - name: Run Forge build
# run: |
# forge --version
# make sizes
# id: build
#
# - name: Run Forge fuzz tests
# run: make fuzz profile=ci
# env:
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/test-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@ jobs:
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

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

- name: Run Forge integration tests
env:
MAINNET_RPC_URL: ${{ secrets.MAINNET_RPC_URL }}
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/test-invariant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@
# - name: Install Foundry
# uses: foundry-rs/foundry-toolchain@v1
#
# - name: Run Forge build
# run: |
# forge --version
# make sizes
# id: build
#
# - name: Run Forge invariant tests
# run: make invariant profile=ci
# env:
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/test-sizes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Forge Sizes Check

on:
push:
branches:
- main
pull_request:

permissions: write-all

jobs:
check:
name: Sizes Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

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

- name: Run Forge build
run: |
forge --version
make sizes
id: build
24 changes: 15 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,13 @@ cp .env.example .env
Run the following command to compile the contracts:

```bash
forge compile
npm run build
```

or

```bash
make build
```

### Coverage
Expand All @@ -46,6 +52,12 @@ Forge is used for coverage, run it with:
npm run coverage
```

or

```bash
make coverage
```

You can then consult the report by opening `coverage/index.html`:

```bash
Expand All @@ -57,19 +69,13 @@ open coverage/index.html
To run all tests:

```bash
forge test
```

Run test that matches a test contract:

```bash
forge test --mc <test-contract-name>
make tests
```

Test a specific test case:

```bash
forge test --mt <test-case-name>
./test.sh -v -t <test-case-name>
```

To run slither:
Expand Down
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export FOUNDRY_PROFILE=$profile
echo Using profile: $FOUNDRY_PROFILE

if [ "$sizes" = false ]; then
forge build --skip '*/test/**/*.t.sol' --skip '*/script/**' --skip '*/lib/forge-std/**' --extra-output-files abi
forge build --skip '*/test/**' --skip '*/script/**' --skip '*/lib/**' --extra-output-files abi
else
forge build --skip '*/test/**/*.t.sol' --skip '*/script/**' --skip '*/lib/forge-std/**' --extra-output-files abi --sizes
forge build --skip '*/test/**' --skip '*/script/**' --skip '*/lib/**' --extra-output-files abi --sizes
fi
9 changes: 2 additions & 7 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
gas_reports = ["*"]
gas_reports_ignore = []
ignored_error_codes = []
optimizer = false
solc_version = "0.8.23"
optimizer = true
optimizer_runs = 999999
verbosity = 3
block_number = 20_270_778
block_timestamp = 1_720_550_400
Expand All @@ -12,8 +13,6 @@ rpc_storage_caching = { chains = ["mainnet"], endpoints = "all" }
evm_version = "shanghai"

[profile.production]
optimizer = true
optimizer_runs = 999999
build_info = true
sizes = true

Expand All @@ -25,10 +24,6 @@ runs = 512 # The number of calls to make in the invariant tests
depth = 25 # The number of times to run the invariant tests
fail_on_revert = true # Fail the test if the contract reverts

[profile.ci]
optimizer = true
optimizer_runs = 999999

[profile.ci.fuzz]
runs = 10_000

Expand Down

0 comments on commit 6b57c30

Please sign in to comment.