napi-rs/.github/workflows/memory-test.yml

74 lines
1.9 KiB
YAML
Raw Normal View History

2021-05-28 19:50:16 +09:00
name: Memory Leak Detect
env:
DEBUG: 'napi:*'
2023-03-12 19:31:13 +09:00
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
2021-05-28 19:50:16 +09:00
on:
push:
branches:
- main
pull_request:
jobs:
build_and_test:
name: Memory leak detect job
runs-on: ubuntu-latest
steps:
2022-04-01 15:29:51 +09:00
- uses: actions/checkout@v3
2021-05-28 19:50:16 +09:00
- name: Setup node
uses: actions/setup-node@v3
2021-05-28 19:50:16 +09:00
with:
2022-12-09 18:29:03 +09:00
node-version: 18
2021-11-19 15:58:21 +09:00
cache: 'yarn'
2021-05-28 19:50:16 +09:00
- name: Install stable
2023-03-12 19:24:48 +09:00
uses: dtolnay/rust-toolchain@stable
2021-05-28 19:50:16 +09:00
with:
2023-03-12 19:24:48 +09:00
targets: x86_64-unknown-linux-gnu
toolchain: stable
2021-05-28 19:50:16 +09:00
2022-04-01 15:29:51 +09:00
- name: Cache cargo
uses: actions/cache@v3
2021-05-28 19:50:16 +09:00
with:
2022-04-01 15:29:51 +09:00
path: |
2022-12-09 18:29:03 +09:00
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
.cargo-cache/registry/index/
.cargo-cache/registry/cache/
.cargo-cache/git/db/
target/
2022-04-01 15:29:51 +09:00
key: stable-memory-leak-detect-cargo-cache
2021-05-28 19:50:16 +09:00
- name: 'Install dependencies'
2022-04-01 15:29:51 +09:00
run: yarn install --immutable
2021-05-28 19:50:16 +09:00
- name: 'Build TypeScript'
run: yarn build
- name: 'Pull docker image'
run: docker pull node:lts-slim
2022-12-09 18:29:03 +09:00
- name: Build in docker
uses: addnab/docker-run-action@v3
with:
image: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian
options: '--user 0:0 -v ${{ github.workspace }}/.cargo-cache/git/db:/usr/local/cargo/git/db -v ${{ github.workspace }}/.cargo/registry/cache:/usr/local/cargo/registry/cache -v ${{ github.workspace }}/.cargo/registry/index:/usr/local/cargo/registry/index -v ${{ github.workspace }}:/build -w /build'
run: yarn build:memory
2021-05-28 19:50:16 +09:00
- name: Memory leak tests
run: yarn test:memory
env:
RUST_BACKTRACE: 1
- name: Clear the cargo caches
run: |
cargo install cargo-cache --no-default-features --features ci-autoclean
cargo-cache