@@ -2,128 +2,108 @@ name: ci
22
33on :
44 push :
5- branches : [main]
65 tags : ["**"]
76 pull_request :
87 branches : [main]
9- types : [labeled, opened, synchronize, reopened]
8+ workflow_dispatch :
109
1110permissions : write-all
1211
1312jobs :
1413 build :
15- name : ${{ matrix.config.variant }} ${{ matrix.config.target }} ${{ matrix.config.v8_enable_pointer_compression && 'ptrcomp' || '' }}
14+ name : ${{ matrix.config.variant }} ${{ matrix.config.target }} ${{ matrix.config.features }}
1615 runs-on : ${{ matrix.config.os }}
1716 timeout-minutes : 180
1817 strategy :
19- # Always run main branch builds to completion. This allows the cache to
20- # stay mostly up-to-date in situations where a single job fails due to
21- # e.g. a flaky test.
22- # Don't fast-fail on tag build because publishing binaries shouldn't be
23- # prevented if 'cargo publish' fails (which can be a false negative).
2418 fail-fast :
2519 ${{ (github.event_name == 'pull_request' || (github.ref !=
2620 ' refs/heads/main' && !startsWith(github.ref, 'refs/tags/'))) &&
2721 !contains(github.event.pull_request.labels.*.name, 'no-fail-fast') }}
2822 matrix :
2923 config :
30- - os : macos-15-large
31- target : x86_64-apple-darwin
32- variant : debug
33- v8_enable_pointer_compression : false
34- cargo : cargo
35-
36- - os : macos-15-large
37- target : x86_64-apple-darwin
38- variant : release
39- v8_enable_pointer_compression : false
40- cargo : cargo
41-
42- - os : macos-15-large
43- target : x86_64-apple-darwin
24+ # ===== macOS ARM64 (none, ptrcomp, sandbox) =====
25+ - os : macos-15
26+ target : aarch64-apple-darwin
4427 variant : debug
45- v8_enable_pointer_compression : true
46- cargo : cargo
47-
48- - os : macos-15-large
49- target : x86_64-apple-darwin
28+ features : none
29+ - os : macos-15
30+ target : aarch64-apple-darwin
5031 variant : release
51- v8_enable_pointer_compression : true
52- cargo : cargo
53-
32+ features : none
5433 - os : macos-15
5534 target : aarch64-apple-darwin
5635 variant : debug
57- v8_enable_pointer_compression : false
58- cargo : cargo
59-
36+ features : ptrcomp
6037 - os : macos-15
6138 target : aarch64-apple-darwin
6239 variant : release
63- v8_enable_pointer_compression : false
64- cargo : cargo
65-
40+ features : ptrcomp
6641 - os : macos-15
6742 target : aarch64-apple-darwin
6843 variant : debug
69- v8_enable_pointer_compression : true
70- cargo : cargo
71-
44+ features : sandbox
7245 - os : macos-15
7346 target : aarch64-apple-darwin
7447 variant : release
75- v8_enable_pointer_compression : true
76- cargo : cargo
48+ features : sandbox
7749
78- - os : ${{ github.repository == 'denoland/rusty_v8' && 'ubuntu-22.04-xl' || 'ubuntu-22.04' }}
50+ # ===== Linux x86_64 (none, ptrcomp, sandbox) =====
51+ - os : ubuntu-22.04
7952 target : x86_64-unknown-linux-gnu
8053 variant : debug
81- v8_enable_pointer_compression : false
82- cargo : cargo
83-
84- - os : ${{ github.repository == 'denoland/rusty_v8' && 'ubuntu-22.04-xl' || 'ubuntu-22.04' }}
54+ features : none
55+ - os : ubuntu-22.04
8556 target : x86_64-unknown-linux-gnu
8657 variant : release
87- v8_enable_pointer_compression : false
88- cargo : cargo
89-
90- - os : ${{ github.repository == 'denoland/rusty_v8' && 'ubuntu-22.04-xl' || 'ubuntu-22.04' }}
58+ features : none
59+ - os : ubuntu-22.04
9160 target : x86_64-unknown-linux-gnu
9261 variant : debug
93- v8_enable_pointer_compression : true
94- cargo : cargo
95-
96- - os : ${{ github.repository == 'denoland/rusty_v8' && 'ubuntu-22.04-xl' || 'ubuntu-22.04' }}
62+ features : ptrcomp
63+ - os : ubuntu-22.04
9764 target : x86_64-unknown-linux-gnu
9865 variant : release
99- v8_enable_pointer_compression : true
100- cargo : cargo
66+ features : ptrcomp
67+ - os : ubuntu-22.04
68+ target : x86_64-unknown-linux-gnu
69+ variant : debug
70+ features : sandbox
71+ - os : ubuntu-22.04
72+ target : x86_64-unknown-linux-gnu
73+ variant : release
74+ features : sandbox
10175
102- - os : ${{ github.repository == 'denoland/rusty_v8' && 'windows-2022-xxl' || 'windows-2022' }}
103- target : x86_64-pc-windows-msvc
104- variant : release # Note: we do not support windows debug builds.
105- v8_enable_pointer_compression : false
106- cargo : cargo
76+ # ===== macOS x86_64 (none only) =====
77+ - os : macos-15-large
78+ target : x86_64-apple-darwin
79+ variant : debug
80+ features : none
81+ - os : macos-15-large
82+ target : x86_64-apple-darwin
83+ variant : release
84+ features : none
10785
108- - os : ${{ github.repository == 'denoland/rusty_v8' && 'ubuntu-22.04-xl' || 'ubuntu-22.04' }}
86+ # ===== Linux ARM64 cross-compile (none only) =====
87+ - os : ubuntu-22.04
10988 target : aarch64-unknown-linux-gnu
11089 variant : debug
111- v8_enable_pointer_compression : false
112- cargo : cargo
113-
114- - os : ${{ github.repository == 'denoland/rusty_v8' && 'ubuntu-22.04-xl' || 'ubuntu-22.04' }}
90+ features : none
91+ - os : ubuntu-22.04
11592 target : aarch64-unknown-linux-gnu
11693 variant : release
117- v8_enable_pointer_compression : false
118- cargo : cargo
94+ features : none
95+
96+ # ===== Windows x86_64 (none, release only) =====
97+ - os : windows-2022
98+ target : x86_64-pc-windows-msvc
99+ variant : release
100+ features : none
119101
120102 env :
121103 V8_FROM_SOURCE : true
122104 CARGO_VARIANT_FLAG : ${{ matrix.config.variant == 'release' && '--release' || '' }}
123- CARGO_FEATURE_FLAGS : ${{ matrix.config.v8_enable_pointer_compression && '--features v8_enable_pointer_compression' || '' }}
124105 LIB_NAME : ${{ contains(matrix.config.target, 'windows') && 'rusty_v8' || 'librusty_v8' }}
125106 LIB_EXT : ${{ contains(matrix.config.target, 'windows') && 'lib' || 'a' }}
126- FEATURES_SUFFIX : ${{ matrix.config.v8_enable_pointer_compression && '_ptrcomp' || '' }}
127107 RUSTFLAGS : -D warnings
128108
129109 steps :
@@ -153,6 +133,20 @@ jobs:
153133 python-version : 3.11.x
154134 architecture : x64
155135
136+ - name : Set cargo feature flags
137+ shell : bash
138+ run : |
139+ if [ "${{ matrix.config.features }}" = "sandbox" ]; then
140+ echo "CARGO_FEATURE_FLAGS=--features v8_enable_sandbox" >> $GITHUB_ENV
141+ echo "FEATURES_SUFFIX=_sandbox" >> $GITHUB_ENV
142+ elif [ "${{ matrix.config.features }}" = "ptrcomp" ]; then
143+ echo "CARGO_FEATURE_FLAGS=--features v8_enable_pointer_compression" >> $GITHUB_ENV
144+ echo "FEATURES_SUFFIX=_ptrcomp" >> $GITHUB_ENV
145+ else
146+ echo "CARGO_FEATURE_FLAGS=" >> $GITHUB_ENV
147+ echo "FEATURES_SUFFIX=" >> $GITHUB_ENV
148+ fi
149+
156150 - name : Install cross compilation toolchain
157151 if : matrix.config.target == 'aarch64-unknown-linux-gnu'
158152 run : |
@@ -176,19 +170,13 @@ jobs:
176170 - name : Cache
177171 uses : actions/cache@v4
178172 with :
179- # Note: rusty_v8 targets always get get rebuilt, and their outputs
180- # ('librusty_v8.rlib', the whole 'gn_out' directory, etc.) can be
181- # quite big, so we cache only those subdirectories of
182- # target/{debug|release} that contain the build output for crates that
183- # come from the registry. By additionally saving the sccache cache
184- # directory it's still possible to build v8 fast.
185173 path : |-
186174 target/sccache
187175 target/*/.*
188176 target/*/build
189177 target/*/deps
190- key : cargo1-${{ matrix.config.target }}-${{ matrix.config.variant }}-${{ matrix.config.v8_enable_pointer_compression }}-${{ hashFiles('Cargo.lock', 'build.rs', 'git_submodule_status.txt') }}
191- restore-keys : cargo1-${{ matrix.config.target }}-${{ matrix.config.variant }}-${{ matrix.config.v8_enable_pointer_compression }}-
178+ key : cargo1-${{ matrix.config.target }}-${{ matrix.config.variant }}-${{ matrix.config.features }}-${{ hashFiles('Cargo.lock', 'build.rs', 'git_submodule_status.txt') }}
179+ restore-keys : cargo1-${{ matrix.config.target }}-${{ matrix.config.variant }}-${{ matrix.config.features }}-
192180
193181 - name : Install and start sccache
194182 shell : pwsh
@@ -234,27 +222,31 @@ jobs:
234222 - name : Test
235223 env :
236224 SCCACHE_IDLE_TIMEOUT : 0
237- if : matrix.config.variant == 'debug' || matrix.config.variant == 'release'
238- run : ${{ matrix.config.cargo }} nextest run -v --cargo-verbose --cargo-verbose --all-targets --locked --target ${{ matrix.config.target }} ${{ env.CARGO_VARIANT_FLAG }} ${{ env.CARGO_FEATURE_FLAGS }}
225+ if : matrix.config.target != 'aarch64-unknown-linux-gnu'
226+ run : cargo nextest run -v --cargo-verbose --cargo-verbose --all-targets --locked --target ${{ matrix.config.target }} ${{ env.CARGO_VARIANT_FLAG }} ${{ env.CARGO_FEATURE_FLAGS }}
227+
228+ - name : Build (cross-compile, no tests)
229+ if : matrix.config.target == 'aarch64-unknown-linux-gnu'
230+ env :
231+ SCCACHE_IDLE_TIMEOUT : 0
232+ run : cargo build --all-targets --locked --target ${{ matrix.config.target }} ${{ env.CARGO_VARIANT_FLAG }} ${{ env.CARGO_FEATURE_FLAGS }}
239233
240234 - name : Clippy
241- run : ${{ matrix.config. cargo }} clippy --all-targets --locked --target ${{ matrix.config.target }} ${{ env.CARGO_VARIANT_FLAG }} ${{ env.CARGO_FEATURE_FLAGS }} -- -D clippy::all
235+ run : cargo clippy --all-targets --locked --target ${{ matrix.config.target }} ${{ env.CARGO_VARIANT_FLAG }} ${{ env.CARGO_FEATURE_FLAGS }} -- -D clippy::all
242236
243237 - name : Prepare binary publish
244- if : matrix.config.variant == 'debug' || matrix.config.variant == 'release'
245238 run : |
246239 gzip -9c target/${{ matrix.config.target }}/${{ matrix.config.variant }}/gn_out/obj/${{ env.LIB_NAME }}.${{ env.LIB_EXT }} > target/${{ env.LIB_NAME }}${{ env.FEATURES_SUFFIX }}_${{ matrix.config.variant }}_${{ matrix.config.target }}.${{ env.LIB_EXT }}.gz
247240 ls -l target/${{ env.LIB_NAME }}${{ env.FEATURES_SUFFIX }}_${{ matrix.config.variant }}_${{ matrix.config.target }}.${{ env.LIB_EXT }}.gz
248241
249- cp target/${{ matrix.config.target }}/${{ matrix.config.variant}}/gn_out/src_binding.rs target/src_binding${{ env.FEATURES_SUFFIX }}_${{ matrix.config.variant }}_${{ matrix.config.target }}.rs
242+ cp target/${{ matrix.config.target }}/${{ matrix.config.variant }}/gn_out/src_binding.rs target/src_binding${{ env.FEATURES_SUFFIX }}_${{ matrix.config.variant }}_${{ matrix.config.target }}.rs
250243 ls -l target/src_binding${{ env.FEATURES_SUFFIX }}_${{ matrix.config.variant }}_${{ matrix.config.target }}.rs
251244
252245 - name : Binary publish
253246 uses : softprops/action-gh-release@v0.1.15
254247 if : >-
255- github.repository == 'denoland/rusty_v8' &&
256- startsWith(github.ref, 'refs/tags/') &&
257- (matrix.config.variant == 'debug' || matrix.config.variant == 'release')
248+ github.repository == 'openworkers/rusty-v8' &&
249+ startsWith(github.ref, 'refs/tags/')
258250 env :
259251 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
260252 with :
@@ -293,7 +285,9 @@ jobs:
293285 uses : cargo-bins/cargo-binstall@main
294286
295287 - name : Install nextest
296- run : cargo binstall cargo-nextest --secure --locked
288+ run : cargo binstall cargo-nextest --secure --locked --no-confirm
289+ env :
290+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
297291
298292 - name : Install python
299293 uses : actions/setup-python@v5
@@ -312,8 +306,8 @@ jobs:
312306 target/*/.*
313307 target/*/build
314308 target/*/deps
315- key : cargo1-aarch64-apple-darwin-asan-false- ${{ hashFiles('Cargo.lock', 'build.rs', 'git_submodule_status.txt') }}
316- restore-keys : cargo1-aarch64-apple-darwin-asan-false-
309+ key : cargo1-aarch64-apple-darwin-asan-${{ hashFiles('Cargo.lock', 'build.rs', 'git_submodule_status.txt') }}
310+ restore-keys : cargo1-aarch64-apple-darwin-asan-
317311
318312 - name : Install and start sccache
319313 shell : pwsh
@@ -338,17 +332,15 @@ jobs:
338332 - name : Test (ASAN)
339333 env :
340334 SCCACHE_IDLE_TIMEOUT : 0
341- # https://github.com/rust-lang/rust/issues/87215
342335 run : |
343336 rustup component add rust-src --toolchain nightly-aarch64-apple-darwin
344- # Is there a better way to install this tool?
345337 curl -O http://commondatastorage.googleapis.com/chromium-browser-clang-staging/Mac/dsymutil-llvmorg-17-init-19076-g5533fc10-1.tgz
346338 tar -C tools/clang/dsymutil/ -xvzf dsymutil-llvmorg-17-init-19076-g5533fc10-1.tgz
347339 V8_FROM_SOURCE=true RUSTFLAGS="-C opt-level=1 -Zsanitizer=address" cargo +nightly -Z build-std nextest run --lib --bins --tests -v --cargo-verbose --cargo-verbose --target aarch64-apple-darwin
348340
349341 build-windows-arm64 :
350342 name : release aarch64-pc-windows-msvc
351- runs-on : ${{ github.repository == 'denoland/rusty_v8' && ' windows-2022-xxl' || 'windows-2022' }}
343+ runs-on : windows-2022
352344 timeout-minutes : 180
353345 env :
354346 CARGO_VARIANT_FLAG : --release
@@ -357,6 +349,7 @@ jobs:
357349 LIB_NAME : rusty_v8
358350 LIB_EXT : lib
359351 FEATURES_SUFFIX : ' '
352+
360353 steps :
361354 - name : Configure git
362355 run : git config --global core.symlinks true
@@ -384,8 +377,8 @@ jobs:
384377 path : |-
385378 target/sccache
386379 target/aarch64-pc-windows-msvc/release/gn_out
387- key : cargo1-aarch64-pc-windows-msvc-release-false- ${{ hashFiles('Cargo.lock', 'build.rs', 'git_submodule_status.txt') }}
388- restore-keys : cargo1-aarch64-pc-windows-msvc-release-false-
380+ key : cargo1-aarch64-pc-windows-msvc-release-${{ hashFiles('Cargo.lock', 'build.rs', 'git_submodule_status.txt') }}
381+ restore-keys : cargo1-aarch64-pc-windows-msvc-release-
389382
390383 - name : Install and start sccache
391384 shell : pwsh
@@ -425,7 +418,9 @@ jobs:
425418
426419 - name : Binary publish
427420 uses : softprops/action-gh-release@v0.1.15
428- if : github.repository == 'denoland/rusty_v8' && startsWith(github.ref, 'refs/tags/')
421+ if : >-
422+ github.repository == 'openworkers/rusty-v8' &&
423+ startsWith(github.ref, 'refs/tags/')
429424 env :
430425 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
431426 with :
@@ -439,50 +434,12 @@ jobs:
439434 name : src_binding_release_aarch64-pc-windows-msvc.rs
440435 path : target/src_binding_release_aarch64-pc-windows-msvc.rs
441436
442- - name : Upload prebuilt library for testing
443- uses : actions/upload-artifact@v4
444- with :
445- name : windows-arm64-prebuilt-release
446- path : |
447- target/rusty_v8_release_aarch64-pc-windows-msvc.lib.gz
448- target/src_binding_release_aarch64-pc-windows-msvc.rs
449- retention-days : 1
450-
451- test-windows-arm64 :
452- name : test aarch64-pc-windows-msvc
453- needs : build-windows-arm64
454- runs-on : ${{ github.repository == 'denoland/rusty_v8' && 'windows-11-arm-xl' || 'windows-11-arm' }}
455- timeout-minutes : 60
456- steps :
457- - name : Configure git
458- run : git config --global core.symlinks true
459-
460- - name : Clone repository
461- uses : actions/checkout@v4
462- with :
463- fetch-depth : 10
464- submodules : recursive
465-
466- - uses : dsherret/rust-toolchain-file@v1
467-
468- - name : Install nextest
469- uses : taiki-e/install-action@nextest
470-
471- - name : Download prebuilt library
472- uses : actions/download-artifact@v4
473- with :
474- name : windows-arm64-prebuilt-release
475-
476- - name : Run tests with prebuilt library
477- env :
478- RUSTY_V8_ARCHIVE : ${{ github.workspace }}/rusty_v8_release_aarch64-pc-windows-msvc.lib.gz
479- RUSTY_V8_SRC_BINDING_PATH : ${{ github.workspace }}/src_binding_release_aarch64-pc-windows-msvc.rs
480- run : cargo nextest run -v --all-targets --locked --target aarch64-pc-windows-msvc --release --no-fail-fast
481-
482437 publish :
483438 needs : [build, build-windows-arm64]
484- runs-on : ${{ github.repository == 'denoland/rusty_v8' && 'ubuntu-22.04-xl' || 'ubuntu-22.04' }}
485- if : github.repository == 'denoland/rusty_v8' && startsWith(github.ref, 'refs/tags/')
439+ runs-on : ubuntu-22.04
440+ if : >-
441+ github.repository == 'openworkers/rusty-v8' &&
442+ startsWith(github.ref, 'refs/tags/')
486443 steps :
487444 - name : Configure git
488445 run : git config --global core.symlinks true
0 commit comments