Skip to content

Commit b975114

Browse files
authored
move ASAN job out of main build matrix (#1900)
Refactor ASAN job of main matrix
1 parent e6a88b3 commit b975114

File tree

1 file changed

+78
-22
lines changed

1 file changed

+78
-22
lines changed

.github/workflows/ci.yml

Lines changed: 78 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,6 @@ jobs:
5151
v8_enable_pointer_compression: true
5252
cargo: cargo
5353

54-
- os: macos-15
55-
target: aarch64-apple-darwin
56-
variant: asan
57-
v8_enable_pointer_compression: false
58-
cargo: cargo
59-
6054
- os: macos-15
6155
target: aarch64-apple-darwin
6256
variant: debug
@@ -227,10 +221,6 @@ jobs:
227221
sudo apt-get install lld-19 clang-19 clang-tools-19 clang-tidy-19 clang-format-19 libclang-19-dev -y
228222
echo "LIBCLANG_PATH=/usr/lib/llvm-19/lib" >> $GITHUB_ENV
229223
230-
- name: Install Rust (nightly)
231-
uses: dtolnay/rust-toolchain@nightly
232-
if: matrix.config.variant == 'asan'
233-
234224
- name: check rust code formatting
235225
run: cargo fmt --check
236226

@@ -239,18 +229,6 @@ jobs:
239229
run: |
240230
clang-format-19 --verbose --Werror --dry-run src/*.cc src/*.hpp src/*.h
241231
242-
- name: Test (ASAN)
243-
env:
244-
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 }}
253-
254232
- name: Test
255233
env:
256234
SCCACHE_IDLE_TIMEOUT: 0
@@ -288,6 +266,84 @@ jobs:
288266
name: src_binding${{ env.FEATURES_SUFFIX }}_${{ matrix.config.variant }}_${{ matrix.config.target }}.rs
289267
path: target/src_binding${{ env.FEATURES_SUFFIX }}_${{ matrix.config.variant }}_${{ matrix.config.target }}.rs
290268

269+
build-asan:
270+
name: asan aarch64-apple-darwin
271+
runs-on: macos-15
272+
timeout-minutes: 180
273+
env:
274+
V8_FROM_SOURCE: true
275+
RUSTFLAGS: -D warnings
276+
277+
steps:
278+
- name: Configure git
279+
run: git config --global core.symlinks true
280+
281+
- name: Clone repository
282+
uses: actions/checkout@v4
283+
with:
284+
fetch-depth: 10
285+
submodules: recursive
286+
287+
- name: Install rust
288+
uses: dsherret/rust-toolchain-file@v1
289+
290+
- name: Install cargo-binstall
291+
uses: cargo-bins/cargo-binstall@main
292+
293+
- name: Install nextest
294+
run: cargo binstall cargo-nextest --secure
295+
296+
- name: Install python
297+
uses: actions/setup-python@v5
298+
with:
299+
python-version: 3.11.x
300+
architecture: x64
301+
302+
- name: Write git_submodule_status.txt
303+
run: git submodule status --recursive > git_submodule_status.txt
304+
305+
- name: Cache
306+
uses: actions/cache@v4
307+
with:
308+
path: |-
309+
target/sccache
310+
target/*/.*
311+
target/*/build
312+
target/*/deps
313+
key: cargo1-aarch64-apple-darwin-asan-false-${{ hashFiles('Cargo.lock', 'build.rs', 'git_submodule_status.txt') }}
314+
restore-keys: cargo1-aarch64-apple-darwin-asan-false-
315+
316+
- name: Install and start sccache
317+
shell: pwsh
318+
env:
319+
SCCACHE_DIR: ${{ github.workspace }}/target/sccache
320+
SCCACHE_CACHE_SIZE: 256M
321+
SCCACHE_IDLE_TIMEOUT: 0
322+
run: |
323+
$version = "v0.8.2"
324+
$platform = "aarch64-apple-darwin"
325+
$basename = "sccache-$version-$platform"
326+
$url = "https://github.com/mozilla/sccache/releases/download/$version/$basename.tar.gz"
327+
cd ~
328+
curl -LO $url
329+
tar -xzvf "$basename.tar.gz"
330+
. $basename/sccache --start-server
331+
echo "$(pwd)/$basename" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
332+
333+
- name: Install Rust (nightly)
334+
uses: dtolnay/rust-toolchain@nightly
335+
336+
- name: Test (ASAN)
337+
env:
338+
SCCACHE_IDLE_TIMEOUT: 0
339+
# https://github.com/rust-lang/rust/issues/87215
340+
run: |
341+
rustup component add rust-src --toolchain nightly-aarch64-apple-darwin
342+
# Is there a better way to install this tool?
343+
curl -O http://commondatastorage.googleapis.com/chromium-browser-clang-staging/Mac/dsymutil-llvmorg-17-init-19076-g5533fc10-1.tgz
344+
tar -C tools/clang/dsymutil/ -xvzf dsymutil-llvmorg-17-init-19076-g5533fc10-1.tgz
345+
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
346+
291347
build-windows-arm64:
292348
name: release aarch64-pc-windows-msvc
293349
runs-on: ${{ github.repository == 'denoland/rusty_v8' && 'windows-2022-xxl' || 'windows-2022' }}

0 commit comments

Comments
 (0)