@@ -2,134 +2,39 @@ name: ci
22
33on :
44 push :
5- branches : [main]
65 tags : ["**"]
7- pull_request :
8- branches : [main]
9- types : [labeled, opened, synchronize, reopened]
6+ workflow_dispatch :
107
118permissions : write-all
129
1310jobs :
1411 build :
15- name : ${{ matrix.config.variant }} ${{ matrix.config.target }} ${{ matrix.config.v8_enable_pointer_compression && ' ptrcomp' || '' }}
12+ name : release ${{ matrix.config.target }} ptrcomp
1613 runs-on : ${{ matrix.config.os }}
1714 timeout-minutes : 180
1815 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).
24- fail-fast :
25- ${{ (github.event_name == 'pull_request' || (github.ref !=
26- ' refs/heads/main' && !startsWith(github.ref, 'refs/tags/'))) &&
27- !contains(github.event.pull_request.labels.*.name, 'no-fail-fast') }}
16+ fail-fast : false
2817 matrix :
2918 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
44- variant : debug
45- v8_enable_pointer_compression : true
46- cargo : cargo
47-
48- - os : macos-15-large
49- target : x86_64-apple-darwin
50- variant : release
51- v8_enable_pointer_compression : true
52- cargo : cargo
53-
54- - os : macos-15
55- target : aarch64-apple-darwin
56- variant : asan
57- v8_enable_pointer_compression : false
58- cargo : cargo
59-
19+ # macOS ARM64 (Apple Silicon)
6020 - os : macos-15
6121 target : aarch64-apple-darwin
62- variant : debug
63- v8_enable_pointer_compression : false
6422 cargo : cargo
6523
66- - os : macos-15
67- target : aarch64-apple-darwin
68- variant : release
69- v8_enable_pointer_compression : false
70- cargo : cargo
71-
72- - os : macos-15
73- target : aarch64-apple-darwin
74- variant : debug
75- v8_enable_pointer_compression : true
76- cargo : cargo
77-
78- - os : macos-15
79- target : aarch64-apple-darwin
80- variant : release
81- v8_enable_pointer_compression : true
82- cargo : cargo
83-
84- - os : ${{ github.repository == 'denoland/rusty_v8' && 'ubuntu-22.04-xl' || 'ubuntu-22.04' }}
85- target : x86_64-unknown-linux-gnu
86- variant : debug
87- v8_enable_pointer_compression : false
88- cargo : cargo
89-
90- - os : ${{ github.repository == 'denoland/rusty_v8' && 'ubuntu-22.04-xl' || 'ubuntu-22.04' }}
24+ # Linux x86_64
25+ - os : ubuntu-22.04
9126 target : x86_64-unknown-linux-gnu
92- variant : release
93- v8_enable_pointer_compression : false
94- cargo : cargo
95-
96- - os : ${{ github.repository == 'denoland/rusty_v8' && 'ubuntu-22.04-xl' || 'ubuntu-22.04' }}
97- target : x86_64-unknown-linux-gnu
98- variant : debug
99- v8_enable_pointer_compression : true
100- cargo : cargo
101-
102- - os : ${{ github.repository == 'denoland/rusty_v8' && 'ubuntu-22.04-xl' || 'ubuntu-22.04' }}
103- target : x86_64-unknown-linux-gnu
104- variant : release
105- v8_enable_pointer_compression : true
106- cargo : cargo
107-
108- - os : ${{ github.repository == 'denoland/rusty_v8' && 'windows-2022-xxl' || 'windows-2022' }}
109- target : x86_64-pc-windows-msvc
110- variant : release # Note: we do not support windows debug builds.
111- v8_enable_pointer_compression : false
11227 cargo : cargo
11328
114- - os : ${{ github.repository == 'denoland/rusty_v8' && 'ubuntu-22.04-xl' || 'ubuntu-22.04' }}
29+ # Linux ARM64 (for Docker arm64 builds)
30+ - os : ubuntu-22.04
11531 target : aarch64-unknown-linux-gnu
116- variant : debug
117- v8_enable_pointer_compression : false
118- cargo : cargo
119-
120- - os : ${{ github.repository == 'denoland/rusty_v8' && 'ubuntu-22.04-xl' || 'ubuntu-22.04' }}
121- target : aarch64-unknown-linux-gnu
122- variant : release
123- v8_enable_pointer_compression : false
12432 cargo : cargo
12533
12634 env :
12735 V8_FROM_SOURCE : true
128- CARGO_VARIANT_FLAG : ${{ matrix.config.variant == 'release' && '--release' || '' }}
129- CARGO_FEATURE_FLAGS : ${{ matrix.config.v8_enable_pointer_compression && '--features v8_enable_pointer_compression' || '' }}
130- LIB_NAME : ${{ contains(matrix.config.target, 'windows') && 'rusty_v8' || 'librusty_v8' }}
131- LIB_EXT : ${{ contains(matrix.config.target, 'windows') && 'lib' || 'a' }}
132- FEATURES_SUFFIX : ${{ matrix.config.v8_enable_pointer_compression && '_ptrcomp' || '' }}
36+ LIB_NAME : librusty_v8
37+ LIB_EXT : a
13338 RUSTFLAGS : -D warnings
13439
13540 steps :
@@ -145,12 +50,6 @@ jobs:
14550 - name : Install rust
14651 uses : dsherret/rust-toolchain-file@v1
14752
148- - name : Install cargo-binstall
149- uses : cargo-bins/cargo-binstall@main
150-
151- - name : Install nextest
152- run : cargo binstall cargo-nextest --secure
153-
15453 - name : Install python
15554 uses : actions/setup-python@v5
15655 with :
@@ -180,19 +79,13 @@ jobs:
18079 - name : Cache
18180 uses : actions/cache@v4
18281 with :
183- # Note: rusty_v8 targets always get get rebuilt, and their outputs
184- # ('librusty_v8.rlib', the whole 'gn_out' directory, etc.) can be
185- # quite big, so we cache only those subdirectories of
186- # target/{debug|release} that contain the build output for crates that
187- # come from the registry. By additionally saving the sccache cache
188- # directory it's still possible to build v8 fast.
18982 path : |-
19083 target/sccache
19184 target/*/.*
19285 target/*/build
19386 target/*/deps
194- key : cargo1-${{ matrix.config.target }}-${{ matrix.config.variant }}-${{ matrix.config.v8_enable_pointer_compression }} -${{ hashFiles('Cargo.lock', 'build.rs', 'git_submodule_status.txt') }}
195- restore-keys : cargo1-${{ matrix.config.target }}-${{ matrix.config.variant }}-${{ matrix.config.v8_enable_pointer_compression }} -
87+ key : cargo1-${{ matrix.config.target }}-release-ptrcomp -${{ hashFiles('Cargo.lock', 'build.rs', 'git_submodule_status.txt') }}
88+ restore-keys : cargo1-${{ matrix.config.target }}-release-ptrcomp -
19689
19790 - name : Install and start sccache
19891 shell : pwsh
@@ -203,11 +96,9 @@ jobs:
20396 run : |
20497 $version = "v0.8.2"
20598 $platform =
206- @{ "x86_64-apple-darwin" = "x86_64-apple-darwin"
207- "aarch64-apple-darwin" = "aarch64-apple-darwin"
99+ @{ "aarch64-apple-darwin" = "aarch64-apple-darwin"
208100 "x86_64-unknown-linux-gnu" = "x86_64-unknown-linux-musl"
209101 "aarch64-unknown-linux-gnu" = "aarch64-unknown-linux-musl"
210- "x86_64-pc-windows-msvc" = "x86_64-pc-windows-msvc"
211102 }['${{ matrix.config.target }}']
212103 $basename = "sccache-$version-$platform"
213104 $url = "https://github.com/mozilla/sccache/releases/download/$version/$basename.tar.gz"
@@ -227,98 +118,37 @@ jobs:
227118 sudo apt-get install lld-19 clang-19 clang-tools-19 clang-tidy-19 clang-format-19 libclang-19-dev -y
228119 echo "LIBCLANG_PATH=/usr/lib/llvm-19/lib" >> $GITHUB_ENV
229120
230- - name : Install Rust (nightly)
231- uses : dtolnay/rust-toolchain@nightly
232- if : matrix.config.variant == 'asan'
233-
234- - name : check rust code formatting
235- run : cargo fmt --check
236-
237- - name : check c++ code formatting
238- if : startsWith(matrix.config.os, 'ubuntu')
239- run : |
240- clang-format-19 --verbose --Werror --dry-run src/*.cc src/*.hpp src/*.h
241-
242- - name : Test (ASAN)
121+ - name : Build
243122 env :
244123 SCCACHE_IDLE_TIMEOUT : 0
245- if : matrix.config.variant == 'asan'
246- # https://github.com/rust-lang/rust/issues/87215
247- run : |
248- rustup component add rust-src --toolchain nightly-${{ matrix.config.target }}
249- # Is there a better way to install this tool?
250- curl -O http://commondatastorage.googleapis.com/chromium-browser-clang-staging/Mac/dsymutil-llvmorg-17-init-19076-g5533fc10-1.tgz
251- tar -C tools/clang/dsymutil/ -xvzf dsymutil-llvmorg-17-init-19076-g5533fc10-1.tgz
252- 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 ${{ matrix.config.target }}
124+ run : ${{ matrix.config.cargo }} build --release --features v8_enable_pointer_compression --locked --target ${{ matrix.config.target }}
253125
254126 - name : Test
127+ if : matrix.config.target != 'aarch64-unknown-linux-gnu'
255128 env :
256129 SCCACHE_IDLE_TIMEOUT : 0
257- if : matrix.config.variant == 'debug' || matrix.config.variant == 'release'
258- 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 }}
259-
260- - name : Clippy
261- run : ${{ matrix.config.cargo }} clippy --all-targets --locked --target ${{ matrix.config.target }} ${{ env.CARGO_VARIANT_FLAG }} ${{ env.CARGO_FEATURE_FLAGS }} -- -D clippy::all
130+ run : ${{ matrix.config.cargo }} test --release --features v8_enable_pointer_compression --locked --target ${{ matrix.config.target }}
262131
263132 - name : Prepare binary publish
264- if : matrix.config.variant == 'debug' || matrix.config.variant == 'release'
265133 run : |
266- 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
267- ls -l target/${{ env.LIB_NAME }}${{ env.FEATURES_SUFFIX }}_${{ matrix.config.variant }}_ ${{ matrix.config.target }}.${{ env.LIB_EXT }}.gz
134+ gzip -9c target/${{ matrix.config.target }}/release /gn_out/obj/${{ env.LIB_NAME }}.${{ env.LIB_EXT }} > target/${{ env.LIB_NAME }}_ptrcomp_release_ ${{ matrix.config.target }}.${{ env.LIB_EXT }}.gz
135+ ls -l target/${{ env.LIB_NAME }}_ptrcomp_release_ ${{ matrix.config.target }}.${{ env.LIB_EXT }}.gz
268136
269- 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
270- ls -l target/src_binding${{ env.FEATURES_SUFFIX }}_${{ matrix.config.variant }}_ ${{ matrix.config.target }}.rs
137+ cp target/${{ matrix.config.target }}/release /gn_out/src_binding.rs target/src_binding_ptrcomp_release_ ${{ matrix.config.target }}.rs
138+ ls -l target/src_binding_ptrcomp_release_ ${{ matrix.config.target }}.rs
271139
272140 - name : Binary publish
273141 uses : softprops/action-gh-release@v0.1.15
274- if : >-
275- github.repository == 'denoland/rusty_v8' &&
276- startsWith(github.ref, 'refs/tags/') &&
277- (matrix.config.variant == 'debug' || matrix.config.variant == 'release')
142+ if : startsWith(github.ref, 'refs/tags/')
278143 env :
279144 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
280145 with :
281146 files : |
282- target/${{ env.LIB_NAME }}${{ env.FEATURES_SUFFIX }}_${{ matrix.config.variant }}_ ${{ matrix.config.target }}.${{ env.LIB_EXT }}.gz
283- target/src_binding${{ env.FEATURES_SUFFIX }}_${{ matrix.config.variant }}_ ${{ matrix.config.target }}.rs
147+ target/${{ env.LIB_NAME }}_ptrcomp_release_ ${{ matrix.config.target }}.${{ env.LIB_EXT }}.gz
148+ target/src_binding_ptrcomp_release_ ${{ matrix.config.target }}.rs
284149
285150 - name : Upload CI artifacts
286151 uses : actions/upload-artifact@v4
287152 with :
288- name : src_binding${{ env.FEATURES_SUFFIX }}_${{ matrix.config.variant }}_${{ matrix.config.target }}.rs
289- path : target/src_binding${{ env.FEATURES_SUFFIX }}_${{ matrix.config.variant }}_${{ matrix.config.target }}.rs
290-
291- publish :
292- needs : build
293- runs-on : ${{ github.repository == 'denoland/rusty_v8' && 'ubuntu-22.04-xl' || 'ubuntu-22.04' }}
294- if : github.repository == 'denoland/rusty_v8' && startsWith(github.ref, 'refs/tags/')
295- steps :
296- - name : Configure git
297- run : git config --global core.symlinks true
298-
299- - name : Clone repository
300- uses : actions/checkout@v4
301- with :
302- fetch-depth : 10
303- submodules : recursive
304-
305- - name : Install rust
306- uses : dsherret/rust-toolchain-file@v1
307-
308- - name : Install python
309- uses : actions/setup-python@v5
310- with :
311- python-version : 3.11.x
312- architecture : x64
313-
314- - name : Download CI artifacts
315- uses : actions/download-artifact@v4
316- with :
317- path : gen
318- pattern : src_binding_*.rs
319- merge-multiple : true
320-
321- - name : Publish
322- env :
323- CARGO_REGISTRY_TOKEN : ${{ secrets.CARGO_REGISTRY_TOKEN }}
324- run : cargo publish -vv --locked --allow-dirty
153+ name : src_binding_ptrcomp_release_${{ matrix.config.target }}.rs
154+ path : target/src_binding_ptrcomp_release_${{ matrix.config.target }}.rs
0 commit comments