2022-01-21 23:51:52 +09:00
|
|
|
name: Address Sanitizer
|
|
|
|
|
|
|
|
env:
|
|
|
|
DEBUG: 'napi:*'
|
|
|
|
|
2023-03-12 19:31:13 +09:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2022-01-21 23:51:52 +09:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
pull_request:
|
|
|
|
|
|
|
|
jobs:
|
2023-07-18 11:38:53 +09:00
|
|
|
test:
|
|
|
|
name: Address sanitizer
|
2022-04-01 15:29:51 +09:00
|
|
|
runs-on: ubuntu-20.04
|
2022-01-21 23:51:52 +09:00
|
|
|
|
|
|
|
steps:
|
2023-09-04 23:34:40 +09:00
|
|
|
- uses: actions/checkout@v4
|
2022-01-21 23:51:52 +09:00
|
|
|
|
|
|
|
- name: Setup node
|
2022-03-05 15:14:32 +09:00
|
|
|
uses: actions/setup-node@v3
|
2022-01-21 23:51:52 +09:00
|
|
|
with:
|
2023-03-12 19:24:48 +09:00
|
|
|
node-version: 18
|
2022-01-21 23:51:52 +09:00
|
|
|
cache: 'yarn'
|
|
|
|
|
|
|
|
- name: Install
|
2023-03-12 19:24:48 +09:00
|
|
|
uses: dtolnay/rust-toolchain@stable
|
2022-01-21 23:51:52 +09:00
|
|
|
with:
|
|
|
|
toolchain: nightly
|
2022-01-22 13:33:44 +09:00
|
|
|
components: rust-src
|
2022-01-21 23:51:52 +09:00
|
|
|
|
2022-04-01 15:29:51 +09:00
|
|
|
- name: Cache cargo
|
|
|
|
uses: actions/cache@v3
|
2022-01-21 23:51:52 +09:00
|
|
|
with:
|
2022-04-01 15:29:51 +09:00
|
|
|
path: |
|
|
|
|
~/.cargo/registry
|
|
|
|
~/.cargo/git
|
2023-03-12 19:24:48 +09:00
|
|
|
key: nightly-ubuntu-node@18-cargo-cache
|
2022-01-21 23:51:52 +09:00
|
|
|
|
|
|
|
- name: 'Install dependencies'
|
2022-04-01 15:29:51 +09:00
|
|
|
run: yarn install --immutable --mode=skip-build
|
2022-01-21 23:51:52 +09:00
|
|
|
|
|
|
|
- name: Unit tests with address sanitizer
|
|
|
|
run: |
|
2023-04-06 12:04:53 +09:00
|
|
|
yarn workspace @examples/napi build -- -Z build-std
|
|
|
|
yarn workspace @examples/compat-mode build -- -Z build-std
|
2022-01-21 23:51:52 +09:00
|
|
|
LD_PRELOAD=/usr/lib/gcc/x86_64-linux-gnu/9/libasan.so yarn test
|
|
|
|
env:
|
|
|
|
RUST_TARGET: x86_64-unknown-linux-gnu
|
|
|
|
RUST_BACKTRACE: 1
|
|
|
|
RUSTFLAGS: -Z sanitizer=address
|
|
|
|
ASAN_OPTIONS: detect_leaks=0
|
|
|
|
|
|
|
|
- name: Clear the cargo caches
|
|
|
|
run: |
|
|
|
|
cargo install cargo-cache --no-default-features --features ci-autoclean
|
|
|
|
cargo-cache
|