Skip to content

Commit 3bc6246

Browse files
committed
test flow 1
1 parent 1402301 commit 3bc6246

File tree

2 files changed

+170
-0
lines changed

2 files changed

+170
-0
lines changed

.github/workflows/bb-ci-flow.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: "CI: Flow"
2+
run-name: "CI Flow :: ${{ github.event.head_commit.message || github.event.pull_request.title }}"
3+
4+
concurrency:
5+
cancel-in-progress: true
6+
group: ${{github.workflow}}-${{github.ref}}
7+
8+
on:
9+
workflow_dispatch:
10+
pull_request:
11+
paths:
12+
- ".github/workflows/bb-ci-flow.yml"
13+
- ".github/workflows/bb-ci-module.yml"
14+
- "flow/**"
15+
- "foundry.base.toml"
16+
- "package.json"
17+
push:
18+
branches:
19+
- "main"
20+
- "bb-staging-demo-new"
21+
paths:
22+
- ".github/workflows/bb-ci-flow.yml"
23+
- ".github/workflows/bb-ci-module.yml"
24+
- "flow/**"
25+
- "foundry.base.toml"
26+
- "package.json"
27+
28+
jobs:
29+
ci:
30+
uses: "./.github/workflows/bb-ci-module.yml"
31+
secrets: inherit
32+
with:
33+
exclude-unit-tests: true
34+
module: "flow"

.github/workflows/bb-ci-module.yml

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
name: "CI: Module (Reusable)"
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
exclude-invariant-tests:
7+
default: false
8+
required: false
9+
type: boolean
10+
exclude-unit-tests:
11+
default: false
12+
required: false
13+
type: boolean
14+
module:
15+
description: "Module name (e.g., airdrops, flow, lockup, utils)"
16+
required: true
17+
type: string
18+
secrets:
19+
CODECOV_TOKEN:
20+
required: false
21+
ROUTEMESH_API_KEY:
22+
required: false
23+
24+
jobs:
25+
check:
26+
uses: "sablier-labs/gha-utils/.github/workflows/full-check.yml@main"
27+
with:
28+
foundry-version: "v1.4.4"
29+
name: "Full check"
30+
working-directory: ${{ inputs.module }}
31+
32+
build:
33+
uses: "sablier-labs/gha-utils/.github/workflows/forge-build.yml@main"
34+
with:
35+
cache-path: |
36+
${{ inputs.module }}/cache
37+
${{ inputs.module }}/node_modules
38+
${{ inputs.module }}/out
39+
${{ inputs.module }}/out-optimized
40+
foundry-version: "v1.4.4"
41+
name: "Build"
42+
working-directory: ${{ inputs.module }}
43+
44+
test-bulloak:
45+
needs: ["build", "check"]
46+
if: needs.build.outputs.cache-status != 'primary'
47+
uses: "sablier-labs/gha-utils/.github/workflows/bulloak-check.yml@main"
48+
with:
49+
name: "Bulloak check"
50+
skip-modifiers: true
51+
test-dir: "${{ inputs.module }}/tests"
52+
working-directory: ${{ inputs.module }}
53+
54+
# test-fork:
55+
# needs: ["build", "check"]
56+
# //if: needs.build.outputs.cache-status != 'primary'
57+
# secrets:
58+
# // ROUTEMESH_API_KEY: ${{ secrets.ROUTEMESH_API_KEY }}
59+
# uses: "itsshantanu/gha-utils/.github/workflows/forge-test.yml@main"
60+
# with:
61+
# cache-path: |
62+
# // ${{ inputs.module }}/cache
63+
# //${{ inputs.module }}/node_modules
64+
# //${{ inputs.module }}/out
65+
# //${{ inputs.module }}/out-optimized
66+
# foundry-fuzz-runs: 20
67+
# foundry-profile: "test-optimized"
68+
# foundry-version: "v1.4.4"
69+
# match-path: "tests/fork/**/*.sol"
70+
# name: "Fork tests"
71+
# //working-directory: ${{ inputs.module }}
72+
73+
test-integration:
74+
needs: ["build", "check"]
75+
if: needs.build.outputs.cache-status != 'primary'
76+
uses: "itsshantanu/gha-utils/.github/workflows/bb-forge-test.yml@demo/bb-ci"
77+
with:
78+
cache-path: |
79+
${{ inputs.module }}/cache
80+
${{ inputs.module }}/node_modules
81+
${{ inputs.module }}/out
82+
${{ inputs.module }}/out-optimized
83+
foundry-profile: "test-optimized"
84+
foundry-version: "v1.4.4"
85+
match-path: "tests/{integration,utils}/**/*.sol"
86+
name: "Integration tests"
87+
working-directory: ${{ inputs.module }}
88+
89+
test-invariant:
90+
needs: ["build", "check"]
91+
if: needs.build.outputs.cache-status != 'primary' && !inputs.exclude-invariant-tests
92+
uses: "itsshantanu/gha-utils/.github/workflows/bb-forge-test.yml@demo/bb-ci"
93+
with:
94+
cache-path: |
95+
${{ inputs.module }}/cache
96+
${{ inputs.module }}/node_modules
97+
${{ inputs.module }}/out
98+
${{ inputs.module }}/out-optimized
99+
foundry-profile: "test-optimized"
100+
foundry-version: "v1.4.4"
101+
match-path: "tests/invariant/**/*.sol"
102+
name: "Invariant tests"
103+
working-directory: ${{ inputs.module }}
104+
105+
test-unit:
106+
needs: ["build", "check"]
107+
if: needs.build.outputs.cache-status != 'primary' && !inputs.exclude-unit-tests
108+
uses: "itsshantanu/gha-utils/.github/workflows/bb-forge-test.yml@demo/bb-ci"
109+
with:
110+
cache-path: |
111+
${{ inputs.module }}/cache
112+
${{ inputs.module }}/node_modules
113+
${{ inputs.module }}/out
114+
${{ inputs.module }}/out-optimized
115+
foundry-profile: "test-optimized"
116+
foundry-version: "v1.4.4"
117+
match-path: "tests/unit/**/*.sol"
118+
name: "Unit tests"
119+
working-directory: ${{ inputs.module }}
120+
# coverage:
121+
# needs: ["build", "check", "test-integration"]
122+
# //if: needs.build.outputs.cache-status != 'primary'
123+
# secrets:
124+
# //CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
125+
# uses: "sablier-labs/gha-utils/.github/workflows/forge-coverage.yml@main"
126+
# with:
127+
# cache-path: |
128+
# //${{ inputs.module }}/cache
129+
# //${{ inputs.module }}/node_modules
130+
# //${{ inputs.module }}/out
131+
# //${{ inputs.module }}/out-optimized
132+
# foundry-version: "v1.4.4"
133+
# match-path: "tests/{integration,unit}/**/*.sol"
134+
# name: "Coverage"
135+
# via-ir-minimum: true
136+
# // working-directory: ${{ inputs.module }}

0 commit comments

Comments
 (0)