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:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- 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
|
|
|
|
|
|
|
|
- name: Generate Cargo.lock
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: generate-lockfile
|
|
|
|
|
|
|
|
- name: Cache cargo registry
|
2021-07-30 14:20:40 +09:00
|
|
|
uses: actions/cache@v2
|
2021-05-28 19:50:16 +09:00
|
|
|
with:
|
|
|
|
path: ~/.cargo/registry
|
|
|
|
key: stable-memory-leak-detect-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
|
|
|
|
|
|
|
|
- name: Cache cargo index
|
2021-07-30 14:20:40 +09:00
|
|
|
uses: actions/cache@v2
|
2021-05-28 19:50:16 +09:00
|
|
|
with:
|
|
|
|
path: ~/.cargo/git
|
|
|
|
key: stable-memory-leak-detect-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }}
|
|
|
|
|
|
|
|
- name: Cache cargo build
|
2021-07-30 14:20:40 +09:00
|
|
|
uses: actions/cache@v2
|
2021-05-28 19:50:16 +09:00
|
|
|
with:
|
|
|
|
path: target
|
|
|
|
key: stable-memory-leak-detect-cargo-build-trimmed-${{ hashFiles('**/Cargo.lock') }}
|
|
|
|
|
|
|
|
- name: Cache NPM dependencies
|
2021-07-30 14:20:40 +09:00
|
|
|
uses: actions/cache@v2
|
2021-05-28 19:50:16 +09:00
|
|
|
with:
|
|
|
|
path: node_modules
|
|
|
|
key: memory-leak-detect-${{ hashFiles('yarn.lock') }}
|
|
|
|
|
|
|
|
- name: 'Install dependencies'
|
2022-01-24 12:33:51 +09:00
|
|
|
run: yarn install --immutable --network-timeout 300000
|
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
|