2021-05-28 19:50:16 +09:00
|
|
|
name: Memory Leak Detect
|
|
|
|
|
|
|
|
env:
|
|
|
|
DEBUG: 'napi:*'
|
|
|
|
|
|
|
|
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
|
2022-03-05 15:14:32 +09:00
|
|
|
uses: actions/setup-node@v3
|
2021-05-28 19:50:16 +09:00
|
|
|
with:
|
2021-11-19 15:58:21 +09:00
|
|
|
node-version: 16
|
2021-05-28 19:50:16 +09:00
|
|
|
check-latest: true
|
2021-11-19 15:58:21 +09:00
|
|
|
cache: 'yarn'
|
2021-05-28 19:50:16 +09:00
|
|
|
|
|
|
|
- name: Install stable
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable-x86_64-unknown-linux-gnu
|
|
|
|
profile: minimal
|
|
|
|
override: true
|
|
|
|
|
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: |
|
|
|
|
~/.cargo/registry
|
|
|
|
~/.cargo/git
|
|
|
|
target
|
|
|
|
key: stable-memory-leak-detect-cargo-cache
|
2021-05-28 19:50:16 +09:00
|
|
|
|
|
|
|
- name: Cache NPM dependencies
|
2022-04-01 15:29:51 +09:00
|
|
|
uses: actions/cache@v3
|
2021-05-28 19:50:16 +09:00
|
|
|
with:
|
2022-04-01 15:29:51 +09:00
|
|
|
path: .yarn/cache
|
|
|
|
key: memory-leak-detect
|
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
|
|
|
|
|
|
|
|
- name: 'Build memory test specs'
|
|
|
|
run: yarn build:memory
|
|
|
|
|
|
|
|
- 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
|