1414 required : false
1515
1616jobs :
17+ include :
18+ name : " include"
19+ runs-on : ubuntu-latest
20+ outputs :
21+ fork-tests : ${{ steps.include.outputs.fork }}
22+ integration-tests : ${{ steps.include.outputs.integration }}
23+ invariant-tests : ${{ steps.include.outputs.invariant }}
24+ unit-tests : ${{ steps.include.outputs.unit }}
25+ steps :
26+ - uses : actions/checkout@v4
27+ - id : include
28+ run : |
29+ echo "fork=$([ -d '${{ inputs.module }}/tests/fork' ] && echo 'true' || echo 'false')" >> $GITHUB_OUTPUT
30+ echo "integration=$([ -d '${{ inputs.module }}/tests/integration' ] && echo 'true' || echo 'false')" >> $GITHUB_OUTPUT
31+ echo "invariant=$([ -d '${{ inputs.module }}/tests/invariant' ] && echo 'true' || echo 'false')" >> $GITHUB_OUTPUT
32+ echo "unit=$([ -d '${{ inputs.module }}/tests/unit' ] && echo 'true' || echo 'false')" >> $GITHUB_OUTPUT
33+
1734 check :
1835 uses : " sablier-labs/gha-utils/.github/workflows/full-check.yml@main"
1936 with :
4158 working-directory : ${{ inputs.module }}
4259
4360 test-fork :
44- needs : ["build", "check"]
45- if : needs.build.outputs.cache-status != 'primary'
61+ needs : ["build", "check", "include" ]
62+ if : needs.build.outputs.cache-status != 'primary' && needs.include.outputs.fork-tests == 'true'
4663 secrets :
4764 ROUTEMESH_API_KEY : ${{ secrets.ROUTEMESH_API_KEY }}
4865 uses : " sablier-labs/gha-utils/.github/workflows/forge-test.yml@main"
@@ -52,15 +69,16 @@ jobs:
5269 ${{ inputs.module }}/node_modules
5370 ${{ inputs.module }}/out
5471 ${{ inputs.module }}/out-optimized
72+ foundry-fuzz-runs : 20
5573 foundry-profile : " test-optimized"
5674 foundry-version : " v1.4.4"
5775 match-path : " tests/fork/**/*.sol"
5876 name : " test-fork"
5977 working-directory : ${{ inputs.module }}
6078
6179 test-integration :
62- needs : ["build", "check"]
63- if : needs.build.outputs.cache-status != 'primary'
80+ needs : ["build", "check", "include" ]
81+ if : needs.build.outputs.cache-status != 'primary' && needs.include.outputs.integration-tests == 'true'
6482 uses : " sablier-labs/gha-utils/.github/workflows/forge-test.yml@main"
6583 with :
6684 cache-path : |
@@ -70,13 +88,13 @@ jobs:
7088 ${{ inputs.module }}/out-optimized
7189 foundry-profile : " test-optimized"
7290 foundry-version : " v1.4.4"
73- match-path : " tests/integration/**/*.sol"
91+ match-path : " tests/{ integration,utils} /**/*.sol"
7492 name : " test-integration"
7593 working-directory : ${{ inputs.module }}
7694
7795 test-invariant :
78- needs : ["build", "check"]
79- if : needs.build.outputs.cache-status != 'primary'
96+ needs : ["build", "check", "include" ]
97+ if : needs.build.outputs.cache-status != 'primary' && needs.include.outputs.invariant-tests == 'true'
8098 uses : " sablier-labs/gha-utils/.github/workflows/forge-test.yml@main"
8199 with :
82100 cache-path : |
91109 working-directory : ${{ inputs.module }}
92110
93111 test-unit :
94- needs : ["build", "check"]
95- if : needs.build.outputs.cache-status != 'primary'
112+ needs : ["build", "check", "include" ]
113+ if : needs.build.outputs.cache-status != 'primary' && needs.include.outputs.unit-tests == 'true'
96114 uses : " sablier-labs/gha-utils/.github/workflows/forge-test.yml@main"
97115 with :
98116 cache-path : |
@@ -107,8 +125,8 @@ jobs:
107125 working-directory : ${{ inputs.module }}
108126
109127 coverage :
110- needs : ["build", "check", "test-integration"]
111- if : needs.build.outputs.cache-status != 'primary'
128+ needs : ["build", "check", "include", " test-integration"]
129+ if : needs.build.outputs.cache-status != 'primary' && needs.include.outputs.integration-tests == 'true'
112130 secrets :
113131 CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
114132 uses : " sablier-labs/gha-utils/.github/workflows/forge-coverage.yml@main"
0 commit comments