66 pull_request :
77 merge_group :
88
9+ # Cancel in-progress runs when a new commit is pushed to the same branch
10+ concurrency :
11+ group : ${{ github.workflow }}-${{ github.ref }}
12+ cancel-in-progress : true
13+
914jobs :
10- test_all :
11- name : Test
15+ # Fast checks first - fail fast on simple issues
16+ # Order: fastest to slowest for single-runner efficiency
17+
18+ conventional_commits :
19+ name : Conventional Commits
20+ runs-on : self-hosted
21+ if : github.event_name == 'pull_request'
1222
13- runs-on : freenet-default-runner
23+ steps :
24+ - uses : actions/checkout@v6
25+ with :
26+ fetch-depth : 0
27+
28+ - name : Check PR title follows Conventional Commits
29+ uses : amannn/action-semantic-pull-request@v6
30+ env :
31+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
32+ with :
33+ types : |
34+ feat
35+ fix
36+ docs
37+ style
38+ refactor
39+ perf
40+ test
41+ build
42+ ci
43+ chore
44+ revert
45+ requireScope : false
46+ subjectPattern : ^(?![A-Z]).+$
47+ subjectPatternError : |
48+ The subject "{subject}" found in the pull request title "{title}"
49+ didn't match the configured pattern. Please ensure that the subject
50+ doesn't start with an uppercase character.
51+
52+ fmt_check :
53+ name : Fmt
54+ runs-on : self-hosted
55+ needs : conventional_commits
56+ if : always() && (needs.conventional_commits.result == 'success' || needs.conventional_commits.result == 'skipped')
57+
58+ steps :
59+ - uses : actions/checkout@v6
60+
61+ - uses : dtolnay/rust-toolchain@stable
62+ with :
63+ toolchain : stable
64+ components : rustfmt
65+
66+ - name : Check code formatting
67+ run : cargo fmt -- --check
68+
69+ clippy_check :
70+ name : Clippy
71+ runs-on : self-hosted
72+ needs : fmt_check
1473
1574 env :
1675 FREENET_LOG : error
1776 CARGO_TARGET_DIR : ${{ github.workspace }}/target
1877
1978 steps :
20- - name : Cancel Previous Runs
21- 22- with :
23- access_token : ${{ github.token }}
24-
2579 - uses : actions/checkout@v6
2680
2781 - uses : dtolnay/rust-toolchain@stable
2882 with :
2983 toolchain : stable
84+ components : clippy
3085 targets : wasm32-unknown-unknown
3186
3287 - uses : Swatinem/rust-cache@v2
33- if : success() || steps.test.conclusion == 'failure'
3488 with :
3589 save-if : ${{ github.ref == 'refs/heads/main' }}
3690
3791 - name : Build
3892 run : |
39- cargo build --locked
40- export PATH="$PWD/target/debug:$PATH"
41- make -C apps/freenet-ping -f run-ping.mk build
42-
43- - name : Test
44- run : cargo test --workspace --no-default-features --features trace,websocket,redb
93+ cargo build --locked --bin fdev --manifest-path ../../crates/fdev/Cargo.toml
94+ export PATH="$PWD/../../target/debug:$PATH"
95+ make -f run-ping.mk build
96+ working-directory : apps/freenet-ping
4597
46- ubertest :
47- name : Ubertest
48- needs : test_all
49- # TODO: Re-enable when ubertest is stable - currently failing
50- if : false
98+ - name : clippy
99+ run : cargo clippy -- -D warnings
51100
52- runs-on : freenet-default-runner
101+ test_all :
102+ name : Test
103+ runs-on : self-hosted
104+ needs : clippy_check
53105
54106 env :
55107 FREENET_LOG : error
56108 CARGO_TARGET_DIR : ${{ github.workspace }}/target
57- UBERTEST_PEER_COUNT : 6 # Fewer peers for faster CI
58109
59110 steps :
60- - name : Cancel Previous Runs
61- 62- with :
63- access_token : ${{ github.token }}
64-
65111 - uses : actions/checkout@v6
66112
67113 - uses : dtolnay/rust-toolchain@stable
@@ -72,33 +118,33 @@ jobs:
72118 - uses : Swatinem/rust-cache@v2
73119 if : success() || steps.test.conclusion == 'failure'
74120 with :
75- save-if : false
76-
77- - name : Install riverctl
78- run : cargo install riverctl
121+ save-if : ${{ github.ref == 'refs/heads/main' }}
79122
80123 - name : Build
81- run : cargo build --locked
124+ run : |
125+ cargo build --locked
126+ export PATH="$PWD/target/debug:$PATH"
127+ make -C apps/freenet-ping -f run-ping.mk build
82128
83- - name : Run Ubertest
84- run : cargo test --test ubertest --no-default-features --features trace,websocket,redb
85- working-directory : crates/core
129+ - name : Clean test directories
130+ run : |
131+ # Remove freenet test directories from /tmp to avoid permission issues
132+ # when tests create directories with different user ownership
133+ rm -rf /tmp/freenet /tmp/freenet-* 2>/dev/null || true
134+
135+ - name : Test
136+ run : cargo test --workspace --no-default-features --features trace,websocket,redb
86137
87138 six_peer_regression :
88139 name : six-peer-regression
89140 needs : test_all
90- runs-on : freenet-default-runner
91- timeout-minutes : 120
141+ runs-on : self-hosted
142+ timeout-minutes : 30
92143
93144 env :
94145 FREENET_LOG : error
95146
96147 steps :
97- - name : Cancel Previous Runs
98- 99- with :
100- access_token : ${{ github.token }}
101-
102148 - uses : actions/checkout@v6
103149 with :
104150 fetch-depth : 0
@@ -133,18 +179,13 @@ jobs:
133179 six_peer_connection_cap :
134180 name : six-peer-connection-cap
135181 needs : test_all
136- runs-on : freenet-default-runner
182+ runs-on : self-hosted
137183
138184 env :
139185 FREENET_LOG : error
140186 CARGO_TARGET_DIR : ${{ github.workspace }}/target
141187
142188 steps :
143- - name : Cancel Previous Runs
144- 145- with :
146- access_token : ${{ github.token }}
147-
148189 - uses : actions/checkout@v6
149190
150191 - uses : dtolnay/rust-toolchain@stable
@@ -163,98 +204,44 @@ jobs:
163204 --features trace,websocket,redb,test-network
164205 -- connection_cap_respected --nocapture
165206
166- clippy_check :
167- name : Clippy
168-
169- runs-on : freenet-default-runner
207+ ubertest :
208+ name : Ubertest
209+ needs : test_all
210+ # TODO: Re-enable when ubertest is stable - currently failing
211+ if : false
212+ runs-on : self-hosted
170213
171214 env :
172215 FREENET_LOG : error
173216 CARGO_TARGET_DIR : ${{ github.workspace }}/target
217+ UBERTEST_PEER_COUNT : 6 # Fewer peers for faster CI
174218
175219 steps :
176- - name : Cancel Previous Runs
177- 178- with :
179- access_token : ${{ github.token }}
180-
181220 - uses : actions/checkout@v6
182221
183222 - uses : dtolnay/rust-toolchain@stable
184223 with :
185224 toolchain : stable
186- components : clippy
187225 targets : wasm32-unknown-unknown
188226
189227 - uses : Swatinem/rust-cache@v2
228+ if : success() || steps.test.conclusion == 'failure'
190229 with :
191- save-if : ${{ github.ref == 'refs/heads/main' }}
192-
193- - name : Build
194- run : |
195- cargo build --locked --bin fdev --manifest-path ../../crates/fdev/Cargo.toml
196- export PATH="$PWD/../../target/debug:$PATH"
197- make -f run-ping.mk build
198- working-directory : apps/freenet-ping
199-
200- - name : clippy
201- run : cargo clippy -- -D warnings
202-
203- fmt_check :
204- name : Fmt
205-
206- runs-on : ubuntu-latest
207-
208- steps :
209- - uses : actions/checkout@v6
210-
211- - uses : dtolnay/rust-toolchain@stable
212- with :
213- toolchain : stable
214- components : rustfmt
215-
216- - name : Check code formatting
217- run : cargo fmt -- --check
218-
219- conventional_commits :
220- name : Conventional Commits
230+ save-if : false
221231
222- runs-on : ubuntu-latest
223- if : github.event_name == 'pull_request'
232+ - name : Install riverctl
233+ run : cargo install riverctl
224234
225- steps :
226- - uses : actions/checkout@v6
227- with :
228- fetch-depth : 0
235+ - name : Build
236+ run : cargo build --locked
229237
230- - name : Check PR title follows Conventional Commits
231- uses : amannn/action-semantic-pull-request@v6
232- env :
233- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
234- with :
235- types : |
236- feat
237- fix
238- docs
239- style
240- refactor
241- perf
242- test
243- build
244- ci
245- chore
246- revert
247- requireScope : false
248- subjectPattern : ^(?![A-Z]).+$
249- subjectPatternError : |
250- The subject "{subject}" found in the pull request title "{title}"
251- didn't match the configured pattern. Please ensure that the subject
252- doesn't start with an uppercase character.
238+ - name : Run Ubertest
239+ run : cargo test --test ubertest --no-default-features --features trace,websocket,redb
240+ working-directory : crates/core
253241
254242 claude-ci-analysis :
255243 name : Claude CI Analysis
256-
257- runs-on : ubuntu-latest
244+ runs-on : self-hosted
258245 needs : [test_all, clippy_check, fmt_check]
259246 if : failure() && contains(github.event.pull_request.labels.*.name, 'claude-debug')
260247
0 commit comments