Skip to content

Commit c9abbe4

Browse files
authored
refactor: move forge test intense workflow into separate file (#391)
* refactor: move forge intense workflow into separate file * refactor: remove and modify some small details
1 parent 419952c commit c9abbe4

File tree

2 files changed

+59
-50
lines changed

2 files changed

+59
-50
lines changed
+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Forge Test (Intense)
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- mainnet
8+
- testnet-holesky
9+
- dev
10+
11+
env:
12+
FOUNDRY_PROFILE: ci
13+
RPC_MAINNET: ${{ secrets.RPC_MAINNET }}
14+
RPC_HOLESKY: ${{ secrets.RPC_HOLESKY }}
15+
CHAIN_ID: ${{ secrets.CHAIN_ID }}
16+
17+
jobs:
18+
# -----------------------------------------------------------------------
19+
# Forge Test (Intense)
20+
# -----------------------------------------------------------------------
21+
22+
forge-test-intense:
23+
name: Test (Intense)
24+
runs-on: ubuntu-latest
25+
steps:
26+
# Check out repository with all submodules for complete codebase access.
27+
- uses: actions/checkout@v4
28+
with:
29+
submodules: recursive
30+
31+
# Install the Foundry toolchain.
32+
- name: Install Foundry
33+
uses: foundry-rs/foundry-toolchain@v1
34+
with:
35+
version: stable
36+
37+
# Build the project and display contract sizes.
38+
- name: Forge Build
39+
run: |
40+
forge --version
41+
forge build --sizes
42+
id: build
43+
44+
# Run Forge Test (Intense)
45+
- name: Forge Test (Intense)
46+
run: |
47+
echo -e "\033[1;33mWarning: This workflow may take several hours to complete.\033[0m"
48+
echo -e "\033[1;33mThis intense fuzzing workflow is optional but helps catch edge cases through extended testing.\033[0m"
49+
FOUNDRY_PROFILE=intense forge test -vvv

.github/workflows/foundry.yml

+10-50
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ on:
44
workflow_dispatch:
55
push:
66
branches:
7-
- master
87
- mainnet
9-
- testnet-goerli
8+
- testnet-holesky
109
- dev
1110
pull_request:
1211

@@ -24,93 +23,54 @@ jobs:
2423
test:
2524
name: Test
2625
runs-on: ubuntu-latest
27-
strategy:
28-
fail-fast: true
2926
steps:
3027
# Check out repository with all submodules for complete codebase access.
3128
- uses: actions/checkout@v4
3229
with:
3330
submodules: recursive
3431

3532
# Install the Foundry toolchain.
36-
- name: "Install Foundry"
33+
- name: Install Foundry
3734
uses: foundry-rs/foundry-toolchain@v1
3835
with:
3936
version: stable
4037

4138
# Run Forge's formatting checker to ensure consistent code style.
42-
- name: "Forge Fmt"
39+
- name: Forge Fmt
4340
run: |
4441
forge fmt --check
4542
id: fmt
4643

4744
# Build the project and display contract sizes.
48-
- name: "Forge Build"
45+
- name: Forge Build
4946
run: |
5047
forge --version
5148
forge build --sizes
5249
id: build
5350

5451
# Run local tests (unit and integration).
55-
- name: "Forge Test (Local)"
52+
- name: Forge Test (Local)
5653
run: forge test -vvv
5754

5855
# Run integration tests using a mainnet fork.
59-
- name: "Forge Test Integration (Fork)"
56+
- name: Forge Test Integration (Fork)
6057
run: FOUNDRY_PROFILE=forktest forge test --match-contract Integration -vvv
6158

62-
# -----------------------------------------------------------------------
63-
# Forge Test (Intense)
64-
# -----------------------------------------------------------------------
65-
66-
continuous-fuzzing:
67-
name: Test (Intense)
68-
runs-on: ubuntu-latest
69-
strategy:
70-
fail-fast: true
71-
steps:
72-
# Check out repository with all submodules for complete codebase access.
73-
- uses: actions/checkout@v4
74-
with:
75-
submodules: recursive
76-
77-
# Install the Foundry toolchain.
78-
- name: "Install Foundry"
79-
uses: foundry-rs/foundry-toolchain@v1
80-
with:
81-
version: stable
82-
83-
# Build the project and display contract sizes.
84-
- name: "Forge Build"
85-
run: |
86-
forge --version
87-
forge build --sizes
88-
id: build
89-
90-
# Run Forge Test (Intense)
91-
- name: Forge Test (Intense)
92-
run: |
93-
echo -e "\033[1;33mWarning: This workflow may take several hours to complete.\033[0m"
94-
echo -e "\033[1;33mThis intense fuzzing workflow is optional but helps catch edge cases through extended testing.\033[0m"
95-
FOUNDRY_PROFILE=intense forge test -vvv
96-
9759
# -----------------------------------------------------------------------
9860
# Forge Coverage
9961
# -----------------------------------------------------------------------
10062

10163
run-coverage:
10264
name: Coverage
10365
runs-on: ubuntu-latest
104-
strategy:
105-
fail-fast: true
10666
steps:
10767
# Check out repository with all submodules for complete codebase access.
10868
- uses: actions/checkout@v4
10969
with:
11070
submodules: recursive
11171

11272
# Install the Foundry toolchain.
113-
- name: "Install Foundry"
73+
- name: Install Foundry
11474
uses: foundry-rs/foundry-toolchain@v1
11575
with:
11676
version: stable
@@ -122,7 +82,7 @@ jobs:
12282
id: lcov
12383

12484
# Build the project and display contract sizes.
125-
- name: "Forge Build"
85+
- name: Forge Build
12686
run: |
12787
forge --version
12888
forge build --sizes
@@ -142,7 +102,7 @@ jobs:
142102
path: report/*
143103

144104
# Check coverage threshold after uploading report
145-
- name: Check Coverage Threshold
105+
- name: Check Coverage Threshold for >=90%
146106
run: |
147107
LINES_PCT=$(lcov --summary lcov.info | grep "lines" | cut -d ':' -f 2 | cut -d '%' -f 1 | tr -d '[:space:]')
148108
FUNCTIONS_PCT=$(lcov --summary lcov.info | grep "functions" | cut -d ':' -f 2 | cut -d '%' -f 1 | tr -d '[:space:]')
@@ -180,7 +140,7 @@ jobs:
180140
submodules: recursive
181141

182142
# Install the Foundry toolchain.
183-
- name: "Install Foundry"
143+
- name: Install Foundry
184144
uses: foundry-rs/foundry-toolchain@v1
185145
with:
186146
version: stable

0 commit comments

Comments
 (0)