Skip to content

Commit 4c96b0e

Browse files
Copilotdannywillems
andcommitted
Speed up CI by decoupling test runs from full build completion
- Add dedicated build-for-tests jobs that run only on ubuntu-22.04 - Add build-tests-for-tests and build-tests-webrtc-for-tests jobs - Update test job dependencies to use dedicated builds instead of matrix builds - Remove artifact uploads from matrix builds (now handled by dedicated jobs) This allows tests to start as soon as ubuntu-22.04 builds complete, rather than waiting for all platform builds (including slower macOS/ARM builds). Co-authored-by: dannywillems <[email protected]>
1 parent 56ffd5d commit 4c96b0e

File tree

1 file changed

+117
-30
lines changed

1 file changed

+117
-30
lines changed

.github/workflows/ci.yaml

Lines changed: 117 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,117 @@ jobs:
174174
- name: Test p2p crate
175175
run: make test-p2p
176176

177+
# Fast builds specifically for test artifacts - no cross-platform matrix
178+
build-for-tests:
179+
timeout-minutes: 60
180+
runs-on: ubuntu-22.04
181+
steps:
182+
- name: Git checkout
183+
uses: actions/checkout@v5
184+
185+
- name: Setup build dependencies
186+
uses: ./.github/actions/setup-build-deps
187+
188+
- name: Use shared OCaml setting up steps
189+
uses: ./.github/actions/setup-ocaml
190+
with:
191+
ocaml_version: 4.14.2
192+
193+
- name: Setup Rust
194+
uses: ./.github/actions/setup-rust
195+
with:
196+
toolchain: 1.84
197+
cache-prefix: build-for-tests-v0
198+
199+
- name: Release build
200+
run: make build-release
201+
202+
- name: Verify build-info command
203+
run: |
204+
echo "Testing build-info command..."
205+
./target/release/mina build-info
206+
207+
# Verify required fields are present
208+
./target/release/mina build-info | grep -E "Version:|Build time:|Commit SHA:|Commit branch:|Rustc version:"
209+
210+
# Verify version format (should be a short commit hash)
211+
VERSION=$(./target/release/mina build-info | grep "Version:" | awk '{print $2}')
212+
if [[ ! "$VERSION" =~ ^[0-9a-f]{7}$ ]]; then
213+
echo "Error: Version should be a 7-character commit hash, got: $VERSION"
214+
exit 1
215+
fi
216+
217+
echo "Build info verification passed!"
218+
219+
- name: Upload binaries
220+
uses: actions/upload-artifact@v4
221+
with:
222+
name: bin-${{ github.sha }}
223+
path: target/release/mina
224+
retention-days: 7
225+
226+
build-tests-for-tests:
227+
timeout-minutes: 60
228+
runs-on: ubuntu-22.04
229+
steps:
230+
- name: Git checkout
231+
uses: actions/checkout@v5
232+
233+
- name: Setup build dependencies
234+
uses: ./.github/actions/setup-build-deps
235+
236+
- name: Use shared OCaml setting up steps
237+
uses: ./.github/actions/setup-ocaml
238+
with:
239+
ocaml_version: 4.14.2
240+
241+
- name: Setup Rust
242+
uses: ./.github/actions/setup-rust
243+
with:
244+
toolchain: 1.84
245+
cache-prefix: build-tests-for-tests-v0
246+
247+
- name: Build tests
248+
run: make build-tests
249+
250+
- name: Upload tests
251+
uses: actions/upload-artifact@v4
252+
with:
253+
name: tests-${{ github.sha }}
254+
path: target/release/tests
255+
retention-days: 7
256+
257+
build-tests-webrtc-for-tests:
258+
timeout-minutes: 60
259+
runs-on: ubuntu-22.04
260+
steps:
261+
- name: Git checkout
262+
uses: actions/checkout@v5
263+
264+
- name: Setup build dependencies
265+
uses: ./.github/actions/setup-build-deps
266+
267+
- name: Use shared OCaml setting up steps
268+
uses: ./.github/actions/setup-ocaml
269+
with:
270+
ocaml_version: 4.14.2
271+
272+
- name: Setup Rust
273+
uses: ./.github/actions/setup-rust
274+
with:
275+
toolchain: 1.84
276+
cache-prefix: build-tests-webrtc-for-tests-v0
277+
278+
- name: Build tests
279+
run: make build-tests-webrtc
280+
281+
- name: Upload tests
282+
uses: actions/upload-artifact@v4
283+
with:
284+
name: tests-webrtc-${{ github.sha }}
285+
path: target/release/tests
286+
retention-days: 7
287+
177288
build:
178289
timeout-minutes: 60
179290
# NOTE: If you add or remove platforms from this matrix, make sure to update
@@ -222,14 +333,6 @@ jobs:
222333
223334
echo "Build info verification passed!"
224335
225-
- name: Upload binaries
226-
if: matrix.os == 'ubuntu-22.04'
227-
uses: actions/upload-artifact@v4
228-
with:
229-
name: bin-${{ github.sha }}
230-
path: target/release/mina
231-
retention-days: 7
232-
233336
build-wasm:
234337
timeout-minutes: 60
235338
# NOTE: If you add or remove platforms from this matrix, make sure to update
@@ -293,14 +396,6 @@ jobs:
293396
- name: Build tests
294397
run: make build-tests
295398

296-
- name: Upload tests
297-
if: matrix.os == 'ubuntu-22.04'
298-
uses: actions/upload-artifact@v4
299-
with:
300-
name: tests-${{ github.sha }}
301-
path: target/release/tests
302-
retention-days: 7
303-
304399
build-tests-webrtc:
305400
timeout-minutes: 60
306401
# NOTE: If you add or remove platforms from this matrix, make sure to update
@@ -332,16 +427,8 @@ jobs:
332427
- name: Build tests
333428
run: make build-tests-webrtc
334429

335-
- name: Upload tests
336-
if: matrix.os == 'ubuntu-22.04'
337-
uses: actions/upload-artifact@v4
338-
with:
339-
name: tests-webrtc-${{ github.sha }}
340-
path: target/release/tests
341-
retention-days: 7
342-
343430
p2p-scenario-tests:
344-
needs: [build-tests, build-tests-webrtc]
431+
needs: [build-tests-for-tests, build-tests-webrtc-for-tests]
345432
runs-on: ubuntu-24.04
346433
timeout-minutes: 20
347434
container:
@@ -412,8 +499,8 @@ jobs:
412499
scenario-tests:
413500
timeout-minutes: 60
414501
needs:
415-
- build-tests
416-
- build-tests-webrtc
502+
- build-tests-for-tests
503+
- build-tests-webrtc-for-tests
417504
runs-on: ubuntu-24.04
418505
container:
419506
image: gcr.io/o1labs-192920/mina-daemon:3.2.0-beta2-939b08d-noble-devnet
@@ -499,8 +586,8 @@ jobs:
499586
record-replay-tests:
500587
timeout-minutes: 30
501588
needs:
502-
- build-tests
503-
- build-tests-webrtc
589+
- build-tests-for-tests
590+
- build-tests-webrtc-for-tests
504591
runs-on: ubuntu-24.04
505592
container:
506593
image: gcr.io/o1labs-192920/mina-daemon:3.2.0-beta2-939b08d-noble-devnet
@@ -536,7 +623,7 @@ jobs:
536623
537624
bootstrap-test:
538625
timeout-minutes: 10
539-
needs: [build, build-tests]
626+
needs: [build-for-tests, build-tests-for-tests]
540627
runs-on: ubuntu-24.04
541628
env:
542629
MINA_HOME: data

0 commit comments

Comments
 (0)