napi-rs/.github/workflows/asan.yml

69 lines
1.5 KiB
YAML
Raw Normal View History

2022-01-21 23:51:52 +09:00
name: Address Sanitizer
env:
DEBUG: 'napi:*'
on:
push:
branches:
- main
pull_request:
jobs:
build_and_test:
2022-04-01 15:29:51 +09:00
name: nightly - ubuntu - node@16
runs-on: ubuntu-20.04
2022-01-21 23:51:52 +09:00
steps:
2022-04-01 15:29:51 +09:00
- uses: actions/checkout@v3
2022-01-21 23:51:52 +09:00
- name: Setup node
uses: actions/setup-node@v3
2022-01-21 23:51:52 +09:00
with:
2022-04-01 15:29:51 +09:00
node-version: 16
2022-01-21 23:51:52 +09:00
check-latest: true
cache: 'yarn'
- name: Install
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
components: rust-src
2022-01-21 23:51:52 +09:00
override: true
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
key: nightly-ubuntu-node@16-cargo-cache
2022-01-21 23:51:52 +09:00
- name: Cache NPM dependencies
2022-04-01 15:29:51 +09:00
uses: actions/cache@v3
2022-01-21 23:51:52 +09:00
with:
2022-04-01 15:29:51 +09:00
path: .yarn/cache
key: npm-cache-ubuntu-node@16
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: 'Build TypeScript'
run: yarn build
- name: Unit tests with address sanitizer
run: |
yarn build:test:asan
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