napi-rs/.github/workflows/asan.yml
forehal a781a4f27e feat(cli): brand new cli tool with both cli and programmatical usage (#1492)
BREAKING CHANGE: requires node >= 16 and some cli options have been renamed
2023-04-06 11:04:53 +08:00

61 lines
1.4 KiB
YAML

name: Address Sanitizer
env:
DEBUG: 'napi:*'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches:
- main
pull_request:
jobs:
build_and_test:
name: nightly - ubuntu - node@16
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
- name: Install
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
components: rust-src
- name: Cache cargo
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
key: nightly-ubuntu-node@18-cargo-cache
- name: 'Install dependencies'
run: yarn install --immutable --mode=skip-build
- name: Unit tests with address sanitizer
run: |
yarn workspace @examples/napi build -- -Z build-std
yarn workspace @examples/compat-mode build -- -Z build-std
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