-
Notifications
You must be signed in to change notification settings - Fork 5.9k
5994 lines (5937 loc) · 306 KB
/
ci.yml
File metadata and controls
5994 lines (5937 loc) · 306 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
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# GENERATED BY ./ci.generate.ts -- DO NOT DIRECTLY EDIT
name: ci
on:
push:
branches:
- main
tags:
- '*'
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
permissions:
contents: write
id-token: write
concurrency:
group: '${{ github.workflow }}-${{ !contains(github.event.pull_request.labels.*.name, ''ci-test-flaky'') && github.head_ref || github.run_id }}'
cancel-in-progress: true
jobs:
pre_build:
name: pre-build
runs-on: ubuntu-latest
outputs:
skip_build: '${{ steps.check.outputs.skip_build }}'
skip_deno_core_test: '${{ steps.deno_core_changes.outputs.skip_deno_core_test }}'
steps:
- name: Configure git
if: github.event_name == 'pull_request'
run: |-
git config --global core.symlinks true
git config --global fetch.parallel 32
- name: Clone repository
uses: actions/checkout@v6
if: github.event_name == 'pull_request'
with:
fetch-depth: 5
submodules: false
- name: Install Deno
uses: denoland/setup-deno@v2
if: github.event_name == 'pull_request'
with:
deno-version: v2.x
- id: check
if: 'github.event_name == ''pull_request'' && github.event.pull_request.draft == true && !contains(github.event.pull_request.labels.*.name, ''ci-draft'')'
run: |-
GIT_MESSAGE=$(git log --format=%s -n 1 ${{github.event.after}})
echo Commit message: $GIT_MESSAGE
echo $GIT_MESSAGE | grep '\[ci\]' || (echo 'Exiting due to draft PR. Commit with [ci] to bypass or add the ci-draft label.' ; echo 'skip_build=true' >> $GITHUB_OUTPUT)
- id: deno_core_changes
if: github.event_name == 'pull_request'
run: |-
git fetch --depth=1 origin ${{ github.event.pull_request.base.sha }}
deno run -A tools/check_deno_core_changes.js ${{ github.event.pull_request.base.sha }}
bench:
name: bench release linux-x86_64
needs:
- pre_build
if: needs.pre_build.outputs.skip_build != 'true'
runs-on: ubuntu-24.04
timeout-minutes: 240
defaults:
run:
shell: bash
steps:
- name: Configure git
if: '(contains(github.event.pull_request.labels.*.name, ''ci-bench'') || github.ref == ''refs/heads/main'') && !startsWith(github.ref, ''refs/tags/'')'
run: |-
git config --global core.symlinks true
git config --global fetch.parallel 32
- name: Clone repository
uses: actions/checkout@v6
if: '(contains(github.event.pull_request.labels.*.name, ''ci-bench'') || github.ref == ''refs/heads/main'') && !startsWith(github.ref, ''refs/tags/'')'
with:
fetch-depth: 5
submodules: false
- name: Restore cache cargo home
uses: actions/cache/restore@v4
if: '(contains(github.event.pull_request.labels.*.name, ''ci-bench'') || github.ref == ''refs/heads/main'') && !startsWith(github.ref, ''refs/tags/'')'
with:
path: |-
~/.cargo/.crates.toml
~/.cargo/.crates2.json
~/.cargo/bin
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
key: never_saved
restore-keys: 102-cargo-home-linux-x86_64-bench-
- name: Install Node
uses: actions/setup-node@v6
if: '(contains(github.event.pull_request.labels.*.name, ''ci-bench'') || github.ref == ''refs/heads/main'') && !startsWith(github.ref, ''refs/tags/'')'
with:
node-version: 22
- uses: dsherret/rust-toolchain-file@v1
if: '(contains(github.event.pull_request.labels.*.name, ''ci-bench'') || github.ref == ''refs/heads/main'') && !startsWith(github.ref, ''refs/tags/'')'
- name: Clone submodule ./tests/bench/testdata/lsp_benchdata
if: '(contains(github.event.pull_request.labels.*.name, ''ci-bench'') || github.ref == ''refs/heads/main'') && !startsWith(github.ref, ''refs/tags/'')'
run: git submodule update --init --recursive --depth=1 -- ./tests/bench/testdata/lsp_benchdata
- name: Clone submodule ./tests/util/std
if: '(contains(github.event.pull_request.labels.*.name, ''ci-bench'') || github.ref == ''refs/heads/main'') && !startsWith(github.ref, ''refs/tags/'')'
run: git submodule update --init --recursive --depth=1 -- ./tests/util/std
- name: Set up incremental LTO and sysroot build
if: '(contains(github.event.pull_request.labels.*.name, ''ci-bench'') || github.ref == ''refs/heads/main'') && !startsWith(github.ref, ''refs/tags/'')'
run: |-
# Setting up sysroot
export DEBIAN_FRONTEND=noninteractive
# Avoid running man-db triggers, which sometimes takes several minutes
# to complete.
sudo apt-get -qq remove --purge -y man-db > /dev/null 2> /dev/null
# Remove older clang before we install
sudo apt-get -qq remove 'clang-12*' 'clang-13*' 'clang-14*' 'clang-15*' 'clang-16*' 'clang-17*' 'clang-18*' 'clang-19*' 'llvm-12*' 'llvm-13*' 'llvm-14*' 'llvm-15*' 'llvm-16*' 'llvm-17*' 'llvm-18*' 'llvm-19*' 'lld-12*' 'lld-13*' 'lld-14*' 'lld-15*' 'lld-16*' 'lld-17*' 'lld-18*' 'lld-19*' > /dev/null 2> /dev/null
# Install clang-XXX, lld-XXX, and debootstrap.
echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-21 main" |
sudo dd of=/etc/apt/sources.list.d/llvm-toolchain-noble-21.list
curl https://apt.llvm.org/llvm-snapshot.gpg.key |
gpg --dearmor |
sudo dd of=/etc/apt/trusted.gpg.d/llvm-snapshot.gpg
sudo apt-get update
# this was unreliable sometimes, so try again if it fails
sudo apt-get install -y --no-install-recommends clang-21 lld-21 clang-tools-21 clang-format-21 clang-tidy-21 || (echo 'Failed. Trying again.' && sudo apt-get clean && sudo apt-get update && sudo apt-get install -y --no-install-recommends clang-21 lld-21 clang-tools-21 clang-format-21 clang-tidy-21)
# Fix alternatives
(yes '' | sudo update-alternatives --force --all) > /dev/null 2> /dev/null || true
clang-21 -c -o /tmp/memfd_create_shim.o tools/memfd_create_shim.c -fPIC
echo "Decompressing sysroot..."
wget -q https://github.com/denoland/deno_sysroot_build/releases/download/sysroot-20250207/sysroot-`uname -m`.tar.xz -O /tmp/sysroot.tar.xz
cd /
xzcat /tmp/sysroot.tar.xz | sudo tar -x
sudo mount --rbind /dev /sysroot/dev
sudo mount --rbind /sys /sysroot/sys
sudo mount --rbind /home /sysroot/home
sudo mount -t proc /proc /sysroot/proc
cd
echo "Done."
# Configure the build environment. Both Rust and Clang will produce
# llvm bitcode only, so we can use lld's incremental LTO support.
# Load the sysroot's env vars
echo "sysroot env:"
cat /sysroot/.env
. /sysroot/.env
# Important notes:
# 1. -ldl seems to be required to avoid a failure in FFI tests. This flag seems
# to be in the Rust default flags in the smoketest, so uncertain why we need
# to be explicit here.
# 2. RUSTFLAGS and RUSTDOCFLAGS must be specified, otherwise the doctests fail
# to build because the object formats are not compatible.
echo "
CARGO_PROFILE_BENCH_INCREMENTAL=false
CARGO_PROFILE_RELEASE_INCREMENTAL=false
RUSTFLAGS<<__1
-C linker-plugin-lto=true
-C linker=clang-21
-C link-arg=-fuse-ld=lld-21
-C link-arg=-ldl
-C link-arg=-Wl,--allow-shlib-undefined
-C link-arg=-Wl,--thinlto-cache-dir=$(pwd)/target/release/lto-cache
-C link-arg=-Wl,--thinlto-cache-policy,cache_size_bytes=700m
-C link-arg=/tmp/memfd_create_shim.o
--cfg tokio_unstable
$RUSTFLAGS
__1
RUSTDOCFLAGS<<__1
-C linker-plugin-lto=true
-C linker=clang-21
-C link-arg=-fuse-ld=lld-21
-C link-arg=-ldl
-C link-arg=-Wl,--allow-shlib-undefined
-C link-arg=-Wl,--thinlto-cache-dir=$(pwd)/target/release/lto-cache
-C link-arg=-Wl,--thinlto-cache-policy,cache_size_bytes=700m
-C link-arg=/tmp/memfd_create_shim.o
--cfg tokio_unstable
$RUSTFLAGS
__1
CC=/usr/bin/clang-21
CFLAGS=$CFLAGS
" > $GITHUB_ENV
- name: Install Deno
uses: denoland/setup-deno@v2
if: '(contains(github.event.pull_request.labels.*.name, ''ci-bench'') || github.ref == ''refs/heads/main'') && !startsWith(github.ref, ''refs/tags/'')'
with:
deno-version: v2.x
- name: Install benchmark tools
if: '(contains(github.event.pull_request.labels.*.name, ''ci-bench'') || github.ref == ''refs/heads/main'') && !startsWith(github.ref, ''refs/tags/'')'
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
run: ./tools/install_prebuilt.js wrk hyperfine
- name: Build deno
if: '(contains(github.event.pull_request.labels.*.name, ''ci-bench'') || github.ref == ''refs/heads/main'') && !startsWith(github.ref, ''refs/tags/'')'
run: cargo build --release -p deno
- name: Run benchmarks
if: '(contains(github.event.pull_request.labels.*.name, ''ci-bench'') || github.ref == ''refs/heads/main'') && !startsWith(github.ref, ''refs/tags/'')'
run: cargo bench -p bench_tests --bench deno_bench --locked
- name: Post benchmarks
if: '!startsWith(github.ref, ''refs/tags/'') && github.repository == ''denoland/deno'' && github.ref == ''refs/heads/main'''
env:
DENOBOT_PAT: '${{ secrets.DENOBOT_PAT }}'
run: |-
git clone --depth 1 --branch gh-pages \
https://${DENOBOT_PAT}@github.com/denoland/benchmark_data.git \
gh-pages
./target/release/deno run --allow-all ./tools/build_benchmark_jsons.js --release
cd gh-pages
git config user.email "propelml@gmail.com"
git config user.name "denobot"
git add .
git commit --message "Update benchmarks"
git push origin gh-pages
- name: Worker info
if: '(contains(github.event.pull_request.labels.*.name, ''ci-bench'') || github.ref == ''refs/heads/main'') && !startsWith(github.ref, ''refs/tags/'')'
run: |-
cat /proc/cpuinfo
cat /proc/meminfo
- name: Cache cargo home
uses: actions/cache/save@v4
if: '!startsWith(github.ref, ''refs/tags/'') && github.ref == ''refs/heads/main'''
with:
path: |-
~/.cargo/.crates.toml
~/.cargo/.crates2.json
~/.cargo/bin
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
key: '102-cargo-home-linux-x86_64-bench-${{ github.sha }}'
build-debug-macos-x86_64:
name: build debug macos-x86_64
needs:
- pre_build
if: needs.pre_build.outputs.skip_build != 'true'
runs-on: macos-15-intel
environment:
name: '${{ (github.ref == ''refs/heads/main'' || startsWith(github.ref, ''refs/tags/'')) && ''build'' || '''' }}'
timeout-minutes: 240
defaults:
run:
shell: bash
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
RUST_LIB_BACKTRACE: 0
steps:
- name: Configure git
run: |-
git config --global core.symlinks true
git config --global fetch.parallel 32
- name: Clone repository
uses: actions/checkout@v6
with:
fetch-depth: 5
submodules: false
- name: Clone submodule ./tests/util/std
run: git submodule update --init --recursive --depth=1 -- ./tests/util/std
- name: Remove macOS cURL --ipv4 flag
run: |-
curl --version
which curl
cat /etc/hosts
rm ~/.curlrc || true
- name: Restore cache cargo home
uses: actions/cache/restore@v4
if: '!startsWith(github.ref, ''refs/tags/'')'
with:
path: |-
~/.cargo/.crates.toml
~/.cargo/.crates2.json
~/.cargo/bin
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
key: never_saved
restore-keys: 102-cargo-home-macos-x86_64-build-main-
- name: Restore cache build output
uses: actions/cache/restore@v4
if: 'github.ref != ''refs/heads/main'' && !startsWith(github.ref, ''refs/tags/'')'
with:
path: |-
./target
!./target/*/gn_out
!./target/*/gn_root
!./target/*/*.zip
!./target/*/*.tar.gz
key: never_saved
restore-keys: 102-cargo-target-macos-x86_64-debug-build-main-
- name: Apply and update mtime cache
uses: ./.github/mtime_cache
with:
cache-path: ./target
- uses: dsherret/rust-toolchain-file@v1
- name: Build debug
env:
CARGO_PROFILE_DEV_DEBUG: 0
run: cargo build --locked --bin deno --bin denort --bin test_server --features=panic-trace
- name: Log versions
run: |-
echo '*** Python'
command -v python && python --version || echo 'No python found or bad executable'
echo '*** Rust'
command -v rustc && rustc --version || echo 'No rustc found or bad executable'
echo '*** Cargo'
command -v cargo && cargo --version || echo 'No cargo found or bad executable'
echo '*** Deno'
command -v deno && deno --version || echo 'No deno found or bad executable'
echo '*** Node'
command -v node && node --version || echo 'No node found or bad executable'
echo '*** Installed packages'
command -v dpkg && dpkg -l || echo 'No dpkg found or bad executable'
- name: Check deno binary
env:
NO_COLOR: 1
run: target/debug/deno eval "console.log(1+2)" | grep 3
- name: Upload artifact debug-macos-x86_64-deno
uses: actions/upload-artifact@v6
with:
name: debug-macos-x86_64-deno
path: target/debug/deno
retention-days: 3
- name: Upload artifact debug-macos-x86_64-denort
uses: actions/upload-artifact@v6
with:
name: debug-macos-x86_64-denort
path: target/debug/denort
retention-days: 3
- name: Upload artifact debug-macos-x86_64-test-server
uses: actions/upload-artifact@v6
with:
name: debug-macos-x86_64-test-server
path: target/debug/test_server
retention-days: 3
- name: Cache cargo home
uses: actions/cache/save@v4
if: 'github.ref == ''refs/heads/main'' && !startsWith(github.ref, ''refs/tags/'')'
with:
path: |-
~/.cargo/.crates.toml
~/.cargo/.crates2.json
~/.cargo/bin
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
key: '102-cargo-home-macos-x86_64-build-main-${{ github.sha }}'
- name: Cache build output
uses: actions/cache/save@v4
if: 'github.ref == ''refs/heads/main'' && !startsWith(github.ref, ''refs/tags/'')'
with:
path: |-
./target
!./target/*/gn_out
!./target/*/gn_root
!./target/*/*.zip
!./target/*/*.tar.gz
key: '102-cargo-target-macos-x86_64-debug-build-main-${{ github.sha }}'
test-debug-macos-x86_64:
name: 'test ${{ matrix.test_crate }} ${{ matrix.shard_label }}debug macos-x86_64'
needs:
- build-debug-macos-x86_64
runs-on: macos-15-intel
timeout-minutes: 30
defaults:
run:
shell: bash
strategy:
matrix:
include:
- test_crate: integration
test_package: integration_tests
shard_index: '0'
shard_total: '2'
shard_label: '(1/2) '
- test_crate: integration
test_package: integration_tests
shard_index: '1'
shard_total: '2'
shard_label: '(2/2) '
- test_crate: node_compat
test_package: node_compat_tests
shard_index: '0'
shard_total: '1'
shard_label: ''
- test_crate: specs
test_package: specs_tests
shard_index: '0'
shard_total: '2'
shard_label: '(1/2) '
- test_crate: specs
test_package: specs_tests
shard_index: '1'
shard_total: '2'
shard_label: '(2/2) '
- test_crate: unit
test_package: unit_tests
shard_index: '0'
shard_total: '1'
shard_label: ''
- test_crate: unit_node
test_package: unit_node_tests
shard_index: '0'
shard_total: '1'
shard_label: ''
fail-fast: false
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
RUST_LIB_BACKTRACE: 0
steps:
- name: Configure git
if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
run: |-
git config --global core.symlinks true
git config --global fetch.parallel 32
- name: Clone repository
uses: actions/checkout@v6
if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
with:
fetch-depth: 5
submodules: false
- name: Clone submodule ./tests/node_compat/runner/suite
if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && matrix.test_crate == ''node_compat'''
run: git submodule update --init --recursive --depth=1 -- ./tests/node_compat/runner/suite
- name: Clone submodule ./tests/util/std
if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
run: git submodule update --init --recursive --depth=1 -- ./tests/util/std
- name: Restore cache cargo home
uses: actions/cache/restore@v4
if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
with:
path: |-
~/.cargo/.crates.toml
~/.cargo/.crates2.json
~/.cargo/bin
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
key: never_saved
restore-keys: '102-cargo-home-macos-x86_64-test-${{ matrix.test_crate }}-'
- name: Restore cache build output
uses: actions/cache/restore@v4
if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && github.ref != ''refs/heads/main'''
with:
path: |-
./target
!./target/*/gn_out
!./target/*/gn_root
!./target/*/*.zip
!./target/*/*.tar.gz
key: never_saved
restore-keys: '102-cargo-target-macos-x86_64-debug-test-${{ matrix.test_crate }}-'
- name: Apply and update mtime cache
uses: ./.github/mtime_cache
if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
with:
cache-path: ./target
- name: Install Node
uses: actions/setup-node@v6
if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
with:
node-version: 22
- uses: dsherret/rust-toolchain-file@v1
if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
- name: Download artifact debug-macos-x86_64-deno
uses: actions/download-artifact@v6
if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
with:
name: debug-macos-x86_64-deno
path: target/debug
- name: Set target/debug/deno permissions
if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
run: chmod +x target/debug/deno
- name: Download artifact debug-macos-x86_64-denort
uses: actions/download-artifact@v6
if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && (matrix.test_crate == ''integration'' || matrix.test_crate == ''specs'')'
with:
name: debug-macos-x86_64-denort
path: target/debug
- name: Set target/debug/denort permissions
if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && (matrix.test_crate == ''integration'' || matrix.test_crate == ''specs'')'
run: chmod +x target/debug/denort
- name: Download artifact debug-macos-x86_64-test-server
uses: actions/download-artifact@v6
if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && (matrix.test_crate == ''integration'' || matrix.test_crate == ''specs'' || matrix.test_crate == ''unit'' || matrix.test_crate == ''unit_node'')'
with:
name: debug-macos-x86_64-test-server
path: target/debug
- name: Set target/debug/test_server permissions
if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && (matrix.test_crate == ''integration'' || matrix.test_crate == ''specs'' || matrix.test_crate == ''unit'' || matrix.test_crate == ''unit_node'')'
run: chmod +x target/debug/test_server
- name: Set up playwright cache
uses: actions/cache@v5
if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
with:
path: ./.ms-playwright
key: 'playwright-${{ runner.os }}-${{ runner.arch }}'
- name: Build ffi (debug)
if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && matrix.test_crate == ''specs'''
run: cargo build -p test_ffi
- name: Test (debug)
if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
env:
CARGO_PROFILE_DEV_DEBUG: 0
CI_SHARD_INDEX: '${{ github.event_name == ''pull_request'' && matrix.shard_index || '''' }}'
CI_SHARD_TOTAL: '${{ github.event_name == ''pull_request'' && matrix.shard_total || '''' }}'
run: 'cargo test -p ${{ matrix.test_package }} --test ${{ matrix.test_crate }}'
- name: Ensure no git changes
if: '!startsWith(github.ref, ''refs/tags/'') && github.event_name == ''pull_request'''
run: "if [[ -n \"$(git status --porcelain)\" ]]; then\necho \"❌ Git working directory is dirty. Ensure `cargo test` is not modifying git tracked files.\"\necho \"\"\necho \"\U0001F4CB Status:\"\ngit status\necho \"\"\nexit 1\nfi"
- name: Upload test results
uses: actions/upload-artifact@v6
if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && always()'
with:
name: 'test-results-macos-x86_64-debug-${{ matrix.test_crate }}${{ matrix.shard_total > 1 && format(''-shard-{0}'', matrix.shard_index) || '''' }}.json'
path: 'target/test_results_${{ matrix.test_crate }}.json'
- name: Cache cargo home
uses: actions/cache/save@v4
if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && github.ref == ''refs/heads/main'''
with:
path: |-
~/.cargo/.crates.toml
~/.cargo/.crates2.json
~/.cargo/bin
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
key: '102-cargo-home-macos-x86_64-test-${{ matrix.test_crate }}-${{ github.sha }}'
- name: Cache build output
uses: actions/cache/save@v4
if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && github.ref == ''refs/heads/main'''
with:
path: |-
./target
!./target/*/gn_out
!./target/*/gn_root
!./target/*/*.zip
!./target/*/*.tar.gz
key: '102-cargo-target-macos-x86_64-debug-test-${{ matrix.test_crate }}-${{ github.sha }}'
build-release-macos-x86_64:
name: build release macos-x86_64
needs:
- pre_build
if: needs.pre_build.outputs.skip_build != 'true'
runs-on: '${{ !contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'' && ''ubuntu-24.04'' || ''macos-15-intel'' }}'
environment:
name: '${{ (github.ref == ''refs/heads/main'' || startsWith(github.ref, ''refs/tags/'')) && ''build'' || '''' }}'
timeout-minutes: 240
defaults:
run:
shell: bash
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
RUST_LIB_BACKTRACE: 0
steps:
- name: Configure git
if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
run: |-
git config --global core.symlinks true
git config --global fetch.parallel 32
- name: Clone repository
uses: actions/checkout@v6
if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
with:
fetch-depth: 5
submodules: false
- name: Clone submodule ./tests/util/std
if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
run: git submodule update --init --recursive --depth=1 -- ./tests/util/std
- name: Remove macOS cURL --ipv4 flag
if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
run: |-
curl --version
which curl
cat /etc/hosts
rm ~/.curlrc || true
- if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'''
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
run: echo $GITHUB_WORKSPACE/third_party/prebuilt/mac >> $GITHUB_PATH
- name: Install Deno
uses: denoland/setup-deno@v2
if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'''
with:
deno-version: v2.x
- name: Restore cache cargo home
uses: actions/cache/restore@v4
if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && !startsWith(github.ref, ''refs/tags/'')'
with:
path: |-
~/.cargo/.crates.toml
~/.cargo/.crates2.json
~/.cargo/bin
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
key: never_saved
restore-keys: 102-cargo-home-macos-x86_64-build-main-
- name: Restore cache build output
uses: actions/cache/restore@v4
if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.ref != ''refs/heads/main'' && !startsWith(github.ref, ''refs/tags/'')'
with:
path: |-
./target
!./target/*/gn_out
!./target/*/gn_root
!./target/*/*.zip
!./target/*/*.tar.gz
key: never_saved
restore-keys: 102-cargo-target-macos-x86_64-release-build-main-
- name: Apply and update mtime cache
uses: ./.github/mtime_cache
if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
with:
cache-path: ./target
- uses: dsherret/rust-toolchain-file@v1
if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
- name: Configure canary build
if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && !startsWith(github.ref, ''refs/tags/'')'
run: echo "DENO_CANARY=true" >> $GITHUB_ENV
- name: Build release
if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'''
run: |-
df -h
cargo build --release --locked --bin deno --bin denort --bin test_server --features=panic-trace
df -h
- name: Generate symcache
if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'''
env:
NO_COLOR: 1
run: |-
target/release/deno -A tools/release/create_symcache.ts ./deno.symcache
du -h deno.symcache
du -h target/release/deno
- name: Install rust-codesign
if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'''
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
run: ./tools/install_prebuilt.js rcodesign
- name: Pre-release (mac)
if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'''
env:
APPLE_CODESIGN_KEY: '${{ secrets.APPLE_CODESIGN_KEY }}'
APPLE_CODESIGN_PASSWORD: '${{ secrets.APPLE_CODESIGN_PASSWORD }}'
run: |-
target/release/deno -A tools/release/create_symcache.ts target/release/deno-x86_64-apple-darwin.symcache
strip -x -S target/release/deno
echo "Key is $(echo $APPLE_CODESIGN_KEY | base64 -d | wc -c) bytes"
rcodesign sign target/release/deno --code-signature-flags=runtime --p12-password="$APPLE_CODESIGN_PASSWORD" --p12-file=<(echo $APPLE_CODESIGN_KEY | base64 -d) --entitlements-xml-file=cli/entitlements.plist
cd target/release
zip -r deno-x86_64-apple-darwin.zip deno
shasum -a 256 deno-x86_64-apple-darwin.zip > deno-x86_64-apple-darwin.zip.sha256sum
strip -x -S ./denort
zip -r denort-x86_64-apple-darwin.zip denort
shasum -a 256 denort-x86_64-apple-darwin.zip > denort-x86_64-apple-darwin.zip.sha256sum
- name: Authenticate with Google Cloud
uses: google-github-actions/auth@v3
if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && (github.ref == ''refs/heads/main'' || startsWith(github.ref, ''refs/tags/''))'
with:
project_id: denoland
credentials_json: '${{ secrets.GCP_SA_KEY }}'
export_environment_variables: true
create_credentials_file: true
- name: Setup gcloud (unix)
uses: google-github-actions/setup-gcloud@v3
if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && (github.ref == ''refs/heads/main'' || startsWith(github.ref, ''refs/tags/''))'
with:
project_id: denoland
- name: Log versions
if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
run: |-
echo '*** Python'
command -v python && python --version || echo 'No python found or bad executable'
echo '*** Rust'
command -v rustc && rustc --version || echo 'No rustc found or bad executable'
echo '*** Cargo'
command -v cargo && cargo --version || echo 'No cargo found or bad executable'
echo '*** Deno'
command -v deno && deno --version || echo 'No deno found or bad executable'
echo '*** Node'
command -v node && node --version || echo 'No node found or bad executable'
echo '*** Installed packages'
command -v dpkg && dpkg -l || echo 'No dpkg found or bad executable'
- name: Upload canary to dl.deno.land
if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && github.ref == ''refs/heads/main'''
env:
AWS_ACCESS_KEY_ID: '${{ vars.S3_ACCESS_KEY_ID }}'
AWS_SECRET_ACCESS_KEY: '${{ secrets.S3_SECRET_ACCESS_KEY }}'
AWS_ENDPOINT_URL_S3: '${{ vars.S3_ENDPOINT }}'
AWS_DEFAULT_REGION: '${{ vars.S3_REGION }}'
run: |-
gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.zip gs://dl.deno.land/canary/$(git rev-parse HEAD)/
gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.sha256sum gs://dl.deno.land/canary/$(git rev-parse HEAD)/
gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.symcache gs://dl.deno.land/canary/$(git rev-parse HEAD)/
aws s3 sync ./target/release/ s3://dl-deno-land/canary/$(git rev-parse HEAD)/ --exclude "*" --include "*.zip"
aws s3 sync ./target/release/ s3://dl-deno-land/canary/$(git rev-parse HEAD)/ --exclude "*" --include "*.sha256sum"
aws s3 sync ./target/release/ s3://dl-deno-land/canary/$(git rev-parse HEAD)/ --exclude "*" --include "*.symcache"
echo ${{ github.sha }} > canary-latest.txt
gsutil -h "Cache-Control: no-cache" cp canary-latest.txt gs://dl.deno.land/canary-$(rustc -vV | sed -n "s|host: ||p")-latest.txt
aws s3 cp canary-latest.txt s3://dl-deno-land/canary-$(rustc -vV | sed -n "s|host: ||p")-latest.txt
rm canary-latest.txt gha-creds-*.json
- name: Build product size info
if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && (github.ref == ''refs/heads/main'' || startsWith(github.ref, ''refs/tags/''))'
run: |-
du -hd1 "./target/release"
du -ha "./target/release/deno"
du -ha "./target/release/denort"
- name: Check deno binary
if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
env:
NO_COLOR: 1
run: target/release/deno eval "console.log(1+2)" | grep 3
- name: Upload artifact release-macos-x86_64-deno
uses: actions/upload-artifact@v6
if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
with:
name: release-macos-x86_64-deno
path: target/release/deno
retention-days: 3
- name: Upload artifact release-macos-x86_64-denort
uses: actions/upload-artifact@v6
if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
with:
name: release-macos-x86_64-denort
path: target/release/denort
retention-days: 3
- name: Upload artifact release-macos-x86_64-test-server
uses: actions/upload-artifact@v6
if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
with:
name: release-macos-x86_64-test-server
path: target/release/test_server
retention-days: 3
- name: Upload release to dl.deno.land (unix)
if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && startsWith(github.ref, ''refs/tags/'')'
env:
AWS_ACCESS_KEY_ID: '${{ vars.S3_ACCESS_KEY_ID }}'
AWS_SECRET_ACCESS_KEY: '${{ secrets.S3_SECRET_ACCESS_KEY }}'
AWS_ENDPOINT_URL_S3: '${{ vars.S3_ENDPOINT }}'
AWS_DEFAULT_REGION: '${{ vars.S3_REGION }}'
run: |-
gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.zip gs://dl.deno.land/release/${GITHUB_REF#refs/*/}/
gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.sha256sum gs://dl.deno.land/release/${GITHUB_REF#refs/*/}/
gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.symcache gs://dl.deno.land/release/${GITHUB_REF#refs/*/}/
aws s3 sync ./target/release/ s3://dl-deno-land/release/${GITHUB_REF#refs/*/}/ --exclude "*" --include "*.zip"
aws s3 sync ./target/release/ s3://dl-deno-land/release/${GITHUB_REF#refs/*/}/ --exclude "*" --include "*.sha256sum"
aws s3 sync ./target/release/ s3://dl-deno-land/release/${GITHUB_REF#refs/*/}/ --exclude "*" --include "*.symcache"
- name: Create release notes
if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && startsWith(github.ref, ''refs/tags/'')'
run: |-
export PATH=$PATH:$(pwd)/target/release
./tools/release/05_create_release_notes.ts
- name: Upload release to GitHub
uses: softprops/action-gh-release@v2
if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && startsWith(github.ref, ''refs/tags/'')'
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
with:
files: |-
target/release/deno-x86_64-pc-windows-msvc.zip
target/release/deno-x86_64-pc-windows-msvc.zip.sha256sum
target/release/denort-x86_64-pc-windows-msvc.zip
target/release/denort-x86_64-pc-windows-msvc.zip.sha256sum
target/release/deno-aarch64-pc-windows-msvc.zip
target/release/deno-aarch64-pc-windows-msvc.zip.sha256sum
target/release/denort-aarch64-pc-windows-msvc.zip
target/release/denort-aarch64-pc-windows-msvc.zip.sha256sum
target/release/deno-x86_64-unknown-linux-gnu.zip
target/release/deno-x86_64-unknown-linux-gnu.zip.sha256sum
target/release/denort-x86_64-unknown-linux-gnu.zip
target/release/denort-x86_64-unknown-linux-gnu.zip.sha256sum
target/release/deno-x86_64-apple-darwin.zip
target/release/deno-x86_64-apple-darwin.zip.sha256sum
target/release/denort-x86_64-apple-darwin.zip
target/release/denort-x86_64-apple-darwin.zip.sha256sum
target/release/deno-aarch64-unknown-linux-gnu.zip
target/release/deno-aarch64-unknown-linux-gnu.zip.sha256sum
target/release/denort-aarch64-unknown-linux-gnu.zip
target/release/denort-aarch64-unknown-linux-gnu.zip.sha256sum
target/release/deno-aarch64-apple-darwin.zip
target/release/deno-aarch64-apple-darwin.zip.sha256sum
target/release/denort-aarch64-apple-darwin.zip
target/release/denort-aarch64-apple-darwin.zip.sha256sum
target/release/deno_src.tar.gz
target/release/lib.deno.d.ts
body_path: target/release/release-notes.md
draft: true
test-release-macos-x86_64:
name: 'test ${{ matrix.test_crate }} ${{ matrix.shard_label }}release macos-x86_64'
needs:
- build-release-macos-x86_64
runs-on: '${{ !contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'' && ''ubuntu-24.04'' || ''macos-15-intel'' }}'
timeout-minutes: 30
defaults:
run:
shell: bash
strategy:
matrix:
include:
- test_crate: integration
test_package: integration_tests
shard_index: '0'
shard_total: '2'
shard_label: '(1/2) '
- test_crate: integration
test_package: integration_tests
shard_index: '1'
shard_total: '2'
shard_label: '(2/2) '
- test_crate: node_compat
test_package: node_compat_tests
shard_index: '0'
shard_total: '1'
shard_label: ''
- test_crate: specs
test_package: specs_tests
shard_index: '0'
shard_total: '2'
shard_label: '(1/2) '
- test_crate: specs
test_package: specs_tests
shard_index: '1'
shard_total: '2'
shard_label: '(2/2) '
- test_crate: unit
test_package: unit_tests
shard_index: '0'
shard_total: '1'
shard_label: ''
- test_crate: unit_node
test_package: unit_node_tests
shard_index: '0'
shard_total: '1'
shard_label: ''
fail-fast: false
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
RUST_LIB_BACKTRACE: 0
steps:
- name: Configure git
if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
run: |-
git config --global core.symlinks true
git config --global fetch.parallel 32
- name: Clone repository
uses: actions/checkout@v6
if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
with:
fetch-depth: 5
submodules: false
- name: Clone submodule ./tests/node_compat/runner/suite
if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && matrix.test_crate == ''node_compat'''
run: git submodule update --init --recursive --depth=1 -- ./tests/node_compat/runner/suite
- name: Clone submodule ./tests/util/std
if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
run: git submodule update --init --recursive --depth=1 -- ./tests/util/std
- name: Restore cache cargo home
uses: actions/cache/restore@v4
if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
with:
path: |-
~/.cargo/.crates.toml
~/.cargo/.crates2.json
~/.cargo/bin
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
key: never_saved
restore-keys: '102-cargo-home-macos-x86_64-test-${{ matrix.test_crate }}-'
- name: Restore cache build output
uses: actions/cache/restore@v4
if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && github.ref != ''refs/heads/main'''
with:
path: |-
./target
!./target/*/gn_out
!./target/*/gn_root
!./target/*/*.zip
!./target/*/*.tar.gz
key: never_saved
restore-keys: '102-cargo-target-macos-x86_64-release-test-${{ matrix.test_crate }}-'
- name: Apply and update mtime cache
uses: ./.github/mtime_cache
if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
with:
cache-path: ./target
- name: Install Node
uses: actions/setup-node@v6
if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
with:
node-version: 22
- uses: dsherret/rust-toolchain-file@v1
if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
- name: Download artifact release-macos-x86_64-deno
uses: actions/download-artifact@v6
if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
with:
name: release-macos-x86_64-deno
path: target/release
- name: Set target/release/deno permissions
if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
run: chmod +x target/release/deno
- name: Download artifact release-macos-x86_64-denort
uses: actions/download-artifact@v6
if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && (matrix.test_crate == ''integration'' || matrix.test_crate == ''specs'')'
with:
name: release-macos-x86_64-denort
path: target/release
- name: Set target/release/denort permissions
if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && (matrix.test_crate == ''integration'' || matrix.test_crate == ''specs'')'
run: chmod +x target/release/denort
- name: Download artifact release-macos-x86_64-test-server
uses: actions/download-artifact@v6
if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && (matrix.test_crate == ''integration'' || matrix.test_crate == ''specs'' || matrix.test_crate == ''unit'' || matrix.test_crate == ''unit_node'')'
with:
name: release-macos-x86_64-test-server
path: target/release
- name: Set target/release/test_server permissions
if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && (matrix.test_crate == ''integration'' || matrix.test_crate == ''specs'' || matrix.test_crate == ''unit'' || matrix.test_crate == ''unit_node'')'
run: chmod +x target/release/test_server
- name: Set up playwright cache
uses: actions/cache@v5
if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
with:
path: ./.ms-playwright
key: 'playwright-${{ runner.os }}-${{ runner.arch }}'
- name: Build ffi (release)
if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && matrix.test_crate == ''specs'''
run: cargo build --release -p test_ffi
- name: Test (release)
if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && github.repository == ''denoland/deno'''
env:
CI_SHARD_INDEX: '${{ github.event_name == ''pull_request'' && matrix.shard_index || '''' }}'
CI_SHARD_TOTAL: '${{ github.event_name == ''pull_request'' && matrix.shard_total || '''' }}'
run: 'cargo test -p ${{ matrix.test_package }} --test ${{ matrix.test_crate }} --release'
- name: Ensure no git changes
if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.event_name == ''pull_request'''
run: "if [[ -n \"$(git status --porcelain)\" ]]; then\necho \"❌ Git working directory is dirty. Ensure `cargo test` is not modifying git tracked files.\"\necho \"\"\necho \"\U0001F4CB Status:\"\ngit status\necho \"\"\nexit 1\nfi"
- name: Upload test results
uses: actions/upload-artifact@v6
if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && always()'
with:
name: 'test-results-macos-x86_64-release-${{ matrix.test_crate }}${{ matrix.shard_total > 1 && format(''-shard-{0}'', matrix.shard_index) || '''' }}.json'
path: 'target/test_results_${{ matrix.test_crate }}.json'
build-debug-macos-aarch64:
name: build debug macos-aarch64
needs:
- pre_build
if: needs.pre_build.outputs.skip_build != 'true'
runs-on: macos-14
environment:
name: '${{ (github.ref == ''refs/heads/main'' || startsWith(github.ref, ''refs/tags/'')) && ''build'' || '''' }}'
timeout-minutes: 240
defaults:
run:
shell: bash
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
RUST_LIB_BACKTRACE: 0
steps:
- name: Configure git
run: |-
git config --global core.symlinks true
git config --global fetch.parallel 32
- name: Clone repository
uses: actions/checkout@v6
with:
fetch-depth: 5
submodules: false
- name: Clone submodule ./tests/util/std
run: git submodule update --init --recursive --depth=1 -- ./tests/util/std
- name: Remove macOS cURL --ipv4 flag
run: |-
curl --version
which curl
cat /etc/hosts
rm ~/.curlrc || true
- env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
run: echo $GITHUB_WORKSPACE/third_party/prebuilt/mac >> $GITHUB_PATH
- name: Install Deno
uses: denoland/setup-deno@v2
with:
deno-version: v2.x
- name: Install macOS aarch64 lld
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
run: ./tools/install_prebuilt.js ld64.lld
- name: Restore cache cargo home
uses: actions/cache/restore@v4
if: '!startsWith(github.ref, ''refs/tags/'')'
with:
path: |-
~/.cargo/.crates.toml