Repository navigation
745 lines (718 loc) · 33.6 KB
/
Copy pathci.yml
File metadata and controls
745 lines (718 loc) · 33.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
# CI: the single required check (ci-ok) for every pull request, on any base.
# Lane selection lives in scripts/ci/lanes.py and scripts/ci/plan.py. Generic
# lanes run in the `nix` and `windows` matrices; a special job exists only where
# a step list cannot be expressed generically (services, OIDC, artifacts, or a
# cache that another workflow writes).
# Never add `paths:` here: ci-ok must always report.
name: CI
on:
pull_request:
merge_group:
types: [checks_requested]
push:
branches: [master]
schedule:
# The nightly lanes on the master tip: refreshes caches and catches misroutes.
# GitHub starts scheduled runs late, often by hours, so nothing may depend on
# exact times (nightly.yml's report waits for this run).
- cron: "17 4 * * *"
workflow_dispatch:
inputs:
lanes:
description: "Lane ids (comma-separated) or 'all'"
type: string
default: all
permissions:
contents: read
concurrency:
# PRs replace superseded runs. Master, queue and dispatch runs are grouped per
# SHA and never cancelled, so every master commit gets a full verdict.
group: ci-${{ github.event_name }}-${{ github.event.pull_request.number || github.event.merge_group.head_sha || github.sha }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: "0"
CARGO_PROFILE_DEV_DEBUG: "0"
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
jobs:
plan:
name: plan
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: read
issues: read # live PR labels: add a label, then re-run
pull-requests: read
outputs:
lanes: ${{ steps.plan.outputs.lanes }}
quarantine: ${{ steps.plan.outputs.quarantine }}
nix: ${{ steps.plan.outputs.nix }}
windows: ${{ steps.plan.outputs.windows }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
filter: blob:none
persist-credentials: false
- name: Select lanes
id: plan
env:
GH_TOKEN: ${{ github.token }}
LANES_INPUT: ${{ inputs.lanes }}
CI_LINUX_RUNNER: ${{ vars.CI_LINUX_RUNNER }}
CI_LINUX_HEAVY_RUNNER: ${{ vars.CI_LINUX_HEAVY_RUNNER }}
CI_MACOS_RUNNER: ${{ vars.CI_MACOS_RUNNER }}
CI_WINDOWS_RUNNER: ${{ vars.CI_WINDOWS_RUNNER }}
CI_QUARANTINE: ${{ vars.CI_QUARANTINE }}
run: python3 scripts/ci/plan.py github
nix:
name: ${{ matrix.id }}
needs: plan
if: needs.plan.outputs.nix != '[]'
strategy:
fail-fast: false
matrix:
include: ${{ fromJSON(needs.plan.outputs.nix) }}
runs-on: ${{ matrix.runner }}
timeout-minutes: ${{ matrix.timeout }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# OpenSecret's flake reads its submodule, which Nix fetches only with full history.
# Blobless history has every commit and tree but only the checked-out files'
# contents, so Nix reads the same source from a ninth of the download.
submodules: ${{ matrix.submodules }}
fetch-depth: ${{ matrix.fetch_depth }}
filter: ${{ matrix.filter }}
- uses: ./.github/actions/setup-nix
- name: Select pinned Xcode
if: runner.os == 'macOS'
run: python3 scripts/ci/select-xcode.py
- name: Restore master's Research Rust cache (read-only)
if: matrix.restore == 'research-rust'
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
# Exactly rust-tests.yml's key and paths; it is the only writer. Its Cargo git
# database spares the PDFOxide fetch Cargo makes for every target.
key: ci-v2-research-rust-${{ hashFiles('apps/maple-research/frontend/src-tauri/Cargo.lock', 'flake.lock') }}
restore-keys: ci-v2-research-rust-
path: |
~/.cache/sccache
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
- name: Rust cache (restore everywhere, save only on master and in the lane's home store)
id: rust-cache
if: matrix.cache != ''
uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
with:
prefix-key: ci-v2
# Restore key: the prefix, the shared key (the lane and its toolchain pins,
# plan.py cache_key) and the runner's rustc versions and CARGO*/RUST* variables.
# The cache key adds third-party Cargo.lock entries and versionless manifests:
# a version bump hits exactly, any other lockfile change restores by prefix.
shared-key: ${{ matrix.cache }}-${{ matrix.cache_key }}
workspaces: ${{ matrix.workspaces }}
cache-targets: ${{ matrix.cache_targets }}
add-rust-environment-hash-key: "true"
# The action runs cargo from the workspace directory: use an absolute flake path.
cmd-format: nix develop --no-update-lock-file ${{ github.workspace }}/${{ matrix.flake }} -c {0}
# cache_save (plan.py): a failover runner never saves into another vendor's store.
save-if: ${{ github.ref == 'refs/heads/master' && (github.event_name == 'push' || github.event_name == 'schedule') && matrix.cache_save }}
- name: Build master's lane cache from one dependency graph
# rust-cache's save keeps every build of a crate still in the graph, so saving after
# a prefix restore would carry the old graph's builds forward: master starts clean.
if: matrix.cache != '' && matrix.cache_targets && steps.rust-cache.outputs.cache-hit != 'true' && github.ref == 'refs/heads/master' && (github.event_name == 'push' || github.event_name == 'schedule') && matrix.cache_save
env:
WORKSPACES: ${{ matrix.workspaces }}
run: |
root=${WORKSPACES%% ->*} target=${WORKSPACES##*-> }
rm -rf "${root:?}/${target:?}"
- name: Run lane
env:
LANE: ${{ matrix.id }}
run: python3 scripts/ci/plan.py run "$LANE"
windows:
name: ${{ matrix.id }}
needs: plan
if: needs.plan.outputs.windows != '[]'
strategy:
fail-fast: false
matrix:
include: ${{ fromJSON(needs.plan.outputs.windows) }}
runs-on: ${{ matrix.runner }}
timeout-minutes: ${{ matrix.timeout }}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: ./.github/actions/setup-agent-windows
- name: Rust cache (restore everywhere, save only on master and in the lane's home store)
id: rust-cache
if: matrix.cache != ''
uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
with:
# Keys as in the nix job: a lockfile change restores by prefix.
prefix-key: ci-v2
shared-key: ${{ matrix.cache }}-${{ matrix.cache_key }}
workspaces: ${{ matrix.workspaces }}
cache-targets: ${{ matrix.cache_targets }}
add-rust-environment-hash-key: "true"
# cache_save (plan.py): a failover runner never saves into another vendor's store.
save-if: ${{ github.ref == 'refs/heads/master' && (github.event_name == 'push' || github.event_name == 'schedule') && matrix.cache_save }}
- name: Build master's lane cache from one dependency graph
# rust-cache's save keeps every build of a crate still in the graph, so saving after
# a prefix restore would carry the old graph's builds forward: master starts clean.
if: matrix.cache != '' && matrix.cache_targets && steps.rust-cache.outputs.cache-hit != 'true' && github.ref == 'refs/heads/master' && (github.event_name == 'push' || github.event_name == 'schedule') && matrix.cache_save
env:
WORKSPACES: ${{ matrix.workspaces }}
run: |
root=${WORKSPACES%% ->*} target=${WORKSPACES##*-> }
rm -rf "${root:?}/${target:?}"
- name: Run lane
env:
LANE: ${{ matrix.id }}
run: python3 scripts/ci/plan.py run "$LANE"
# Unsigned Dev packages built like agent-desktop-build.yml's master builds, from
# their own thin-LTO cache, which only the nightly run saves. Run by ci:package,
# ci:full and the nightly run.
agent-package-linux:
name: agent-package-linux
needs: plan
if: fromJSON(needs.plan.outputs.lanes)['agent-package-linux']
runs-on: ${{ vars.CI_LINUX_RUNNER || 'blacksmith-8vcpu-ubuntu-2404' }}
timeout-minutes: 60
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: ./.github/actions/setup-nix
- name: Restore the packaging rehearsal cache
id: package-cache
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
# Thin-LTO release artifacts; master's fat-LTO cache cannot serve them.
key: ci-v1-agent-package-${{ runner.os }}-${{ hashFiles('apps/maple-agent/flake.lock', 'apps/maple-agent/Cargo.lock') }}
restore-keys: ci-v1-agent-package-${{ runner.os }}-
path: |
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
apps/maple-agent/target
- name: Build and package an unsigned Dev bundle
run: python3 scripts/ci/plan.py run agent-package-linux
- name: Save the packaging rehearsal cache (nightly, Blacksmith only)
if: ${{ github.ref == 'refs/heads/master' && github.event_name == 'schedule' && startsWith(runner.name, 'blacksmith') && steps.package-cache.outputs.cache-hit != 'true' }}
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
key: ${{ steps.package-cache.outputs.cache-primary-key }}
path: |
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
apps/maple-agent/target
- name: Upload the unsigned package
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: maple-agent-dev-linux-x86_64-unsigned-${{ github.run_id }}
path: apps/maple-agent/dist/dev/
if-no-files-found: error
retention-days: 7
# Blacksmith's macOS image cannot download Xcode's Metal Toolchain, so GitHub's
# xcode-27 image exports it for the lanes that compile gpui's shaders.
metal-toolchain:
name: metal-toolchain
needs: plan
if: fromJSON(needs.plan.outputs.lanes)['metal-toolchain']
runs-on: xcode-27
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Select pinned Xcode
run: python3 scripts/ci/select-xcode.py
- uses: ./.github/actions/export-metal-toolchain
agent-package-macos:
name: agent-package-macos
needs: [plan, metal-toolchain]
if: fromJSON(needs.plan.outputs.lanes)['agent-package-macos']
runs-on: ${{ vars.CI_MACOS_RUNNER || 'blacksmith-6vcpu-macos-27' }}
timeout-minutes: 60
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: ./.github/actions/setup-nix
- name: Select pinned Xcode
run: python3 scripts/ci/select-xcode.py
- uses: ./.github/actions/import-metal-toolchain
- name: Restore the packaging rehearsal cache
id: package-cache
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
# Thin-LTO release artifacts; master's fat-LTO cache cannot serve them.
# The Xcode pin leads, so a prefix restore never brings back another SDK's objects.
key: ci-v1-agent-package-${{ runner.os }}-${{ hashFiles('scripts/ci/apple-toolchain.json') }}-${{ hashFiles('apps/maple-agent/flake.lock', 'apps/maple-agent/Cargo.lock') }}
restore-keys: ci-v1-agent-package-${{ runner.os }}-${{ hashFiles('scripts/ci/apple-toolchain.json') }}-
path: |
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
apps/maple-agent/target
- name: Build and package an unsigned Dev app
run: python3 scripts/ci/plan.py run agent-package-macos
- name: Save the packaging rehearsal cache (nightly, Blacksmith only)
if: ${{ github.ref == 'refs/heads/master' && github.event_name == 'schedule' && startsWith(runner.name, 'blacksmith') && steps.package-cache.outputs.cache-hit != 'true' }}
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
key: ${{ steps.package-cache.outputs.cache-primary-key }}
path: |
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
apps/maple-agent/target
- name: Upload the unsigned package
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: maple-agent-dev-macos-aarch64-unsigned-${{ github.run_id }}
path: apps/maple-agent/dist/dev/
if-no-files-found: error
retention-days: 7
agent-package-windows:
name: agent-package-windows
needs: plan
if: fromJSON(needs.plan.outputs.lanes)['agent-package-windows']
runs-on: ${{ vars.CI_WINDOWS_GITHUB_RUNNER || 'maple-windows-2025-16core' }}
timeout-minutes: 90
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: ./.github/actions/setup-agent-windows
with:
release: "true"
- name: Restore the packaging rehearsal cache
id: package-cache
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
# Thin-LTO release artifacts; master's fat-LTO cache cannot serve them.
key: ci-v1-agent-package-${{ runner.os }}-${{ hashFiles('apps/maple-agent/flake.lock', 'apps/maple-agent/Cargo.lock') }}
restore-keys: ci-v1-agent-package-${{ runner.os }}-
path: |
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
apps/maple-agent/target
- name: Build and package an unsigned Dev installer
run: python3 scripts/ci/plan.py run agent-package-windows
- name: Save the packaging rehearsal cache (nightly, GitHub's runners only)
if: ${{ github.ref == 'refs/heads/master' && github.event_name == 'schedule' && !startsWith(runner.name, 'blacksmith') && steps.package-cache.outputs.cache-hit != 'true' }}
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
key: ${{ steps.package-cache.outputs.cache-primary-key }}
path: |
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
apps/maple-agent/target
- name: Upload the unsigned package
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: maple-agent-dev-windows-x86_64-unsigned-${{ github.run_id }}
path: apps/maple-agent/dist/dev/
if-no-files-found: error
retention-days: 7
# Native ARM64 installer rehearsal, independent of all x64 build artifacts.
agent-package-windows-arm64:
name: agent-package-windows-arm64
needs: plan
if: fromJSON(needs.plan.outputs.lanes)['agent-package-windows-arm64']
runs-on: windows-11-arm
timeout-minutes: 120
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: ./.github/actions/setup-agent-windows
with:
release: "true"
architecture: aarch64
- name: Restore the packaging rehearsal cache
id: package-cache
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
# ARM64 leads, so neither this family nor the x64 Windows one
# (ci-v1-agent-package-Windows-) restores the other's objects by prefix.
key: ci-v1-agent-package-ARM64-${{ runner.os }}-${{ hashFiles('apps/maple-agent/flake.lock', 'apps/maple-agent/Cargo.lock') }}
restore-keys: ci-v1-agent-package-ARM64-${{ runner.os }}-
path: |
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
apps/maple-agent/target
- name: Build and package an unsigned native ARM64 installer
run: python3 scripts/ci/plan.py run agent-package-windows-arm64
- name: Save the packaging rehearsal cache (nightly)
if: ${{ github.ref == 'refs/heads/master' && github.event_name == 'schedule' && steps.package-cache.outputs.cache-hit != 'true' }}
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
key: ${{ steps.package-cache.outputs.cache-primary-key }}
path: |
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
apps/maple-agent/target
- name: Upload the unsigned native ARM64 installer
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: maple-agent-dev-windows-aarch64-unsigned-${{ github.run_id }}
path: apps/maple-agent/dist/dev/
if-no-files-found: error
retention-days: 7
# Research Rust on PRs, warm from rust-tests.yml's master cache (read-only).
research-rust:
name: research-rust
needs: plan
if: fromJSON(needs.plan.outputs.lanes)['research-rust']
runs-on: ${{ vars.CI_LINUX_RUNNER || 'blacksmith-8vcpu-ubuntu-2404' }}
timeout-minutes: 45
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: ./.github/actions/setup-nix
- name: Restore master's Research Rust cache (read-only)
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
# Exactly rust-tests.yml's key and paths; it is the only writer.
key: ci-v2-research-rust-${{ hashFiles('apps/maple-research/frontend/src-tauri/Cargo.lock', 'flake.lock') }}
restore-keys: ci-v2-research-rust-
path: |
~/.cache/sccache
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
- name: Check formatting and local dependencies, then test
run: python3 scripts/ci/plan.py run research-rust
# Unsigned Research platform builds. They restore what the master signed
# builds save and never save anything.
research-ios:
name: research-ios
needs: plan
if: fromJSON(needs.plan.outputs.lanes)['research-ios']
runs-on: ${{ vars.CI_MACOS_RUNNER || 'blacksmith-6vcpu-macos-27' }}
timeout-minutes: 120 # a missed ONNX Runtime cache builds it from source
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Select pinned Xcode
id: select_xcode
run: python3 scripts/ci/select-xcode.py
- uses: ./.github/actions/setup-nix
- name: Restore master's ONNX Runtime iOS artifact (read-only)
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: |
apps/maple-research/frontend/src-tauri/onnxruntime-ios
key: release-onnxruntime-ios-artifact-1.23.2-xcode${{ steps.select_xcode.outputs.version }}-${{ steps.select_xcode.outputs.build }}-${{ hashFiles('flake.lock', 'flake.nix', 'scripts/ci/apple-toolchain.json', 'scripts/ci/select-xcode.py', 'scripts/ci/_common.sh', 'scripts/ci/ios-onnxruntime.sh', 'apps/maple-research/frontend/src-tauri/scripts/build-ios-onnxruntime-all.sh', 'apps/maple-research/frontend/src-tauri/scripts/canonicalize-static-archive.py', 'apps/maple-research/frontend/src-tauri/scripts/onnxruntime-pins.sh') }}
restore-keys: |
release-onnxruntime-ios-artifact-1.23.2-xcode${{ steps.select_xcode.outputs.version }}-${{ steps.select_xcode.outputs.build }}-
- name: Build the iOS simulator app
run: python3 scripts/ci/plan.py run research-ios
- name: Upload the simulator app
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: maple-ios-simulator-pr
path: |
apps/maple-research/frontend/src-tauri/gen/apple/build/**/*.app
apps/maple-research/frontend/src-tauri/target/reproducibility/ios-*.sha256
retention-days: 5
research-desktop-macos:
name: research-desktop-macos
needs: plan
if: fromJSON(needs.plan.outputs.lanes)['research-desktop-macos']
runs-on: ${{ vars.CI_MACOS_RUNNER || 'blacksmith-6vcpu-macos-27' }}
timeout-minutes: 45
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Select pinned Xcode
run: python3 scripts/ci/select-xcode.py
- uses: ./.github/actions/setup-nix
- name: Restore master's macOS sccache (read-only)
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/Library/Caches/Mozilla.sccache
key: ${{ runner.os }}-sccache-macos-release-${{ hashFiles('apps/maple-research/frontend/src-tauri/Cargo.lock') }}
restore-keys: ${{ runner.os }}-sccache-macos-release-
- name: Build the unsigned universal app and DMG
run: python3 scripts/ci/plan.py run research-desktop-macos
- name: Upload the unsigned app
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: maple-macos-universal-pr
path: |
apps/maple-research/frontend/src-tauri/target/universal-apple-darwin/release/bundle/dmg/*.dmg
apps/maple-research/frontend/src-tauri/target/universal-apple-darwin/release/bundle/macos/*.app
apps/maple-research/frontend/src-tauri/target/reproducibility/maple-macos-app.tar.gz
apps/maple-research/frontend/src-tauri/target/reproducibility/desktop-pr-macos-*.sha256
retention-days: 5
research-desktop-linux:
name: research-desktop-linux
needs: plan
if: fromJSON(needs.plan.outputs.lanes)['research-desktop-linux']
runs-on: ${{ vars.CI_LINUX_RUNNER || 'blacksmith-8vcpu-ubuntu-2404' }}
timeout-minutes: 45
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: ./.github/actions/setup-nix
- name: Restore master's Linux sccache (read-only)
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.cache/sccache
key: ${{ runner.os }}-sccache-linux-release-${{ hashFiles('apps/maple-research/frontend/src-tauri/Cargo.lock') }}
restore-keys: ${{ runner.os }}-sccache-linux-release-
- name: Allow bubblewrap user namespaces
# Ubuntu 24.04 restricts them; AppImage packaging fails without them.
run: |
if [ -e /proc/sys/kernel/apparmor_restrict_unprivileged_userns ]; then
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
fi
if [ -e /proc/sys/kernel/unprivileged_userns_clone ]; then
sudo sysctl -w kernel.unprivileged_userns_clone=1
fi
- name: Build unsigned packages with fake updater signatures
run: python3 scripts/ci/plan.py run research-desktop-linux
- name: Upload the packages
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: maple-linux-pr
path: |
apps/maple-research/frontend/src-tauri/target/release/bundle/appimage/*.AppImage
apps/maple-research/frontend/src-tauri/target/release/bundle/appimage/*.AppImage.sig
apps/maple-research/frontend/src-tauri/target/release/bundle/deb/*.deb
apps/maple-research/frontend/src-tauri/target/release/bundle/deb/*.deb.sig
apps/maple-research/frontend/src-tauri/target/release/bundle/rpm/*.rpm
apps/maple-research/frontend/src-tauri/target/release/bundle/rpm/*.rpm.sig
apps/maple-research/frontend/src-tauri/target/reproducibility/desktop-pr-linux-fake-updater.pub
apps/maple-research/frontend/src-tauri/target/reproducibility/desktop-pr-linux-*.sha256
retention-days: 5
# Builds the unsigned installer, then verifies its proofs, as desktop-build.yml's
# Linux verifier does for the signed one.
research-desktop-windows:
name: research-desktop-windows
needs: plan
if: fromJSON(needs.plan.outputs.lanes)['research-desktop-windows']
runs-on: ${{ vars.CI_WINDOWS_GITHUB_RUNNER || 'maple-windows-2025-16core' }}
timeout-minutes: 60
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: 1.3.5
no-cache: true # its post step would save the binary from a pull request
- uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable action, exact toolchain below
with:
toolchain: 1.94.1 # desktop-build.yml's Windows toolchain
- name: Build the unsigned installer and verify its proofs
run: python3 scripts/ci/plan.py run research-desktop-windows
- name: Upload the installer and its proofs
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: maple-windows-x64-pr
path: |
apps/maple-research/frontend/src-tauri/target/release/bundle/nsis/*.exe
apps/maple-research/frontend/src-tauri/target/release/maple.exe
apps/maple-research/frontend/src-tauri/resources/windows/*.dll
apps/maple-research/frontend/src-tauri/target/reproducibility/desktop-pr-windows-*.sha256
retention-days: 5
research-dev-macos:
name: research-dev-macos
needs: plan
if: fromJSON(needs.plan.outputs.lanes)['research-dev-macos']
runs-on: ${{ vars.CI_MACOS_RUNNER || 'blacksmith-6vcpu-macos-27' }}
timeout-minutes: 45
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
# The package's evidence names the exact PR head, not the merge commit.
ref: ${{ github.event.pull_request.head.sha || github.sha }}
persist-credentials: false
- name: Select pinned Xcode
run: python3 scripts/ci/select-xcode.py
- uses: ./.github/actions/setup-nix
- name: Build the unsigned Research Dev app
run: python3 scripts/ci/plan.py run research-dev-macos
- name: Upload the Dev package and its identity proof
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: maple-research-dev-macos-pr
path: |
apps/maple-research/frontend/src-tauri/target/research-dev/maple-research-dev-macos.tar.gz
apps/maple-research/frontend/src-tauri/target/research-dev/build-profile.json
if-no-files-found: error
retention-days: 5
# Both SDKs against the in-tree OpenSecret backend and a disposable PostgreSQL.
os-sdk-e2e:
name: os-sdk-e2e
needs: plan
if: fromJSON(needs.plan.outputs.lanes)['os-sdk-e2e']
runs-on: ${{ vars.CI_LINUX_RUNNER || 'blacksmith-8vcpu-ubuntu-2404' }}
timeout-minutes: 45
services:
postgres:
image: postgres:17
env:
POSTGRES_DB: opensecret
POSTGRES_PASSWORD: password
POSTGRES_USER: opensecret_user
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U opensecret_user -d opensecret"
--health-interval 5s
--health-timeout 5s
--health-retries 12
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
submodules: recursive
# Nix requires revCount for recursively fetched Git inputs; blobless
# history keeps every commit, so Nix reads the same source.
fetch-depth: 0
filter: blob:none
- uses: ./.github/actions/setup-nix
- name: Migrate, start OpenSecret and run both SDKs' integration suites
run: python3 scripts/ci/plan.py run os-sdk-e2e
# OpenSecret's parent-side helper images (they run beside the enclave, not in
# the EIF): built for ARM64 and tested offline, never published, then scanned.
os-helpers:
name: os-helpers (${{ matrix.helper }})
needs: plan
if: fromJSON(needs.plan.outputs.lanes)['os-helpers']
runs-on: ubuntu-24.04-arm
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
helper: [credential-requester, enclave-logging]
env:
HELPER: ${{ matrix.helper }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Build the Linux ARM64 image and run its tests offline
run: python3 scripts/ci/plan.py run os-helpers
- name: Scan finished image for fixable high and critical vulnerabilities
uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0
with:
version: v0.75.0
image-ref: ${{ matrix.helper }}:ci
format: table
exit-code: '1'
ignore-unfixed: true
severity: HIGH,CRITICAL
scanners: vuln
cache: "false" # pull requests save no caches
# The PR EIF candidate: dev and prod EIFs built on the release builder's runner
# class, never signed or published. The planner selects it only for
# same-repository PRs to master whose diff has EIF inputs (or the ci:eif label)
# and edits no PCR approval (opensecret-eif.yml compares approval edits);
# because it mints an OIDC token for the FlakeHub cache, the event, base branch
# and head repository are checked here too.
os-eif:
name: os-eif (${{ matrix.mode }})
needs: plan
if: >-
${{
fromJSON(needs.plan.outputs.lanes)['os-eif'] &&
github.event_name == 'pull_request' &&
github.event.pull_request.base.ref == 'master' &&
github.event.pull_request.head.repo.full_name == github.repository
}}
permissions:
contents: read
id-token: write
runs-on: blacksmith-16vcpu-ubuntu-2404-arm
timeout-minutes: 180
strategy:
fail-fast: false
matrix:
mode: [dev, prod]
env:
EIF_MODE: ${{ matrix.mode }}
OPENSECRET_DEV_POSTGRES: "0"
OPENSECRET_DEV_ENV: "0"
OPENSECRET_DEV_CONTAINERS: "0"
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
submodules: recursive
# Blobless full history: the same source, narHash and EIF derivation as a full clone.
fetch-depth: 0
filter: blob:none
- name: Install pinned Determinate Nix for FlakeHub authentication
uses: DeterminateSystems/determinate-nix-action@16f94ba7aae399b9f9077c254b6719ec6de7e3e3 # v3.24.2
with:
source-tag: v3.24.2
github-token: ""
- name: Verify pinned Nix runtime
run: bash scripts/ci/verify-nix-runtime.sh
- name: Reuse FlakeHub with an Actions cache fallback
uses: DeterminateSystems/flakehub-cache-action@f00fba8dc0949d63cbbb7d33da7912417d588d75 # v3.24.2
with:
diff-store: true
# No Actions artifact, attestation, signing, or release is produced here.
# The Nix cache is only a build cache, not an approved deployment handoff.
- name: Build PR candidate without signing or publication
shell: bash
run: |
echo 'PR diagnostic only: source_sha is the PR merge ref, not a release source commit. No approved artifact is uploaded.' >> "$GITHUB_STEP_SUMMARY"
bash scripts/ci/build_opensecret_eif.sh "$EIF_MODE" "$RUNNER_TEMP/eif-candidate-$EIF_MODE"
- name: Inspect exact PR candidate user ramdisk CA bundle
shell: bash
run: python3 scripts/ci/verify_opensecret_eif_rootfs.py "$EIF_MODE" "$RUNNER_TEMP/eif-candidate-$EIF_MODE" "$GITHUB_SHA"
ci-ok:
name: ci-ok
if: always()
needs: [plan, nix, windows, agent-package-linux, metal-toolchain, agent-package-macos, agent-package-windows, agent-package-windows-arm64, research-rust,
research-ios, research-desktop-macos, research-desktop-linux, research-desktop-windows,
research-dev-macos, os-sdk-e2e, os-helpers, os-eif]
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: read
actions: read # the run's job results, read only to attribute a quarantined lane's failure
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
sparse-checkout: scripts/ci
- name: Every selected lane succeeded
env:
GH_TOKEN: ${{ github.token }}
NEEDS: ${{ toJSON(needs) }}
run: python3 scripts/ci/plan.py verdict