Skip to content

Commit 92d966b

Browse files
authored
ci: add path filter for intense test (#1320)
**Motivation:** not every commit or code change need a 2h intense test, only solidity and workflow config changes need **Modifications:** add path filter for intense test **Result:** only solidity and workflow config changes will trigger intense test
1 parent 52c8e84 commit 92d966b

File tree

2 files changed

+64
-48
lines changed

2 files changed

+64
-48
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Foundry Post Merge
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
paths:
9+
- '.github/workflows/foundry-post-merge.yml'
10+
- 'src/**'
11+
- 'lib/**'
12+
- 'foundry.toml'
13+
- '**/*.sol'
14+
15+
16+
env:
17+
FOUNDRY_PROFILE: medium
18+
19+
jobs:
20+
# -----------------------------------------------------------------------
21+
# Forge Test (Intense)
22+
# -----------------------------------------------------------------------
23+
24+
continuous-fuzzing:
25+
name: Test (Intense)
26+
runs-on: protocol-x64-16core
27+
strategy:
28+
fail-fast: true
29+
steps:
30+
# Check out repository with all submodules for complete codebase access.
31+
- uses: actions/checkout@v4
32+
with:
33+
submodules: recursive
34+
35+
# Restore Forge cache
36+
- name: Cache Forge Build
37+
uses: actions/cache@v3
38+
with:
39+
path: |
40+
cache/
41+
out/
42+
key: ${{ runner.os }}-forge-${{ hashFiles('**/foundry.toml', '**/remappings.txt', 'src/**/*.sol', 'lib/**/*.sol') }}
43+
restore-keys: |
44+
${{ runner.os }}-forge-
45+
46+
# Install the Foundry toolchain.
47+
- name: "Install Foundry"
48+
uses: foundry-rs/foundry-toolchain@v1
49+
with:
50+
version: stable
51+
52+
# Build the project and display contract sizes.
53+
- name: "Forge Build"
54+
run: |
55+
forge --version
56+
forge build --sizes
57+
id: build
58+
59+
# Run Forge Test (Intense)
60+
- name: Forge Test (Intense)
61+
run: |
62+
echo -e "\033[1;33mWarning: This workflow may take several hours to complete.\033[0m"
63+
echo -e "\033[1;33mThis intense fuzzing workflow is optional but helps catch edge cases through extended testing.\033[0m"
64+
FOUNDRY_PROFILE=intense forge test -vvv

.github/workflows/foundry.yml

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -71,54 +71,6 @@ jobs:
7171
FOUNDRY_PROFILE: ${{ matrix.suite == 'Fork' && 'forktest' || 'medium' }}
7272
RPC_MAINNET: https://billowing-capable-sound.quiknode.pro/
7373

74-
# -----------------------------------------------------------------------
75-
# Forge Test (Intense)
76-
# -----------------------------------------------------------------------
77-
78-
continuous-fuzzing:
79-
name: Test (Intense)
80-
runs-on: protocol-x64-16core
81-
# Only run on push events to main branch, not on PR events
82-
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
83-
strategy:
84-
fail-fast: true
85-
steps:
86-
# Check out repository with all submodules for complete codebase access.
87-
- uses: actions/checkout@v4
88-
with:
89-
submodules: recursive
90-
91-
# Restore Forge cache
92-
- name: Cache Forge Build
93-
uses: actions/cache@v3
94-
with:
95-
path: |
96-
cache/
97-
out/
98-
key: ${{ runner.os }}-forge-${{ hashFiles('**/foundry.toml', '**/remappings.txt', 'src/**/*.sol', 'lib/**/*.sol') }}
99-
restore-keys: |
100-
${{ runner.os }}-forge-
101-
102-
# Install the Foundry toolchain.
103-
- name: "Install Foundry"
104-
uses: foundry-rs/foundry-toolchain@v1
105-
with:
106-
version: stable
107-
108-
# Build the project and display contract sizes.
109-
- name: "Forge Build"
110-
run: |
111-
forge --version
112-
forge build --sizes
113-
id: build
114-
115-
# Run Forge Test (Intense)
116-
- name: Forge Test (Intense)
117-
run: |
118-
echo -e "\033[1;33mWarning: This workflow may take several hours to complete.\033[0m"
119-
echo -e "\033[1;33mThis intense fuzzing workflow is optional but helps catch edge cases through extended testing.\033[0m"
120-
FOUNDRY_PROFILE=intense forge test -vvv
121-
12274
# -----------------------------------------------------------------------
12375
# Forge Storage Diff
12476
# -----------------------------------------------------------------------

0 commit comments

Comments
 (0)