-
Notifications
You must be signed in to change notification settings - Fork 7
81 lines (71 loc) · 2.62 KB
/
asan.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Address Sanitizer
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_id || github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
test-cargo:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: addnab/docker-run-action@v3
with:
registry: gcr.io
image: ghcr.io/markusjx/node-java-bridge/java-bridge-asan-testcontainer:latest
options: -v ${{ github.workspace }}/crates/java-rs:/app
run: |
cargo update
cargo test --all-features -Zbuild-std --target=x86_64-unknown-linux-gnu
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
check-latest: true
cache: 'npm'
- name: Setup java 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Rust Cache
uses: Swatinem/[email protected]
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Remove target and dist directories
run: |
rm -rf dist
mv target target.bak
- name: Run tests with address sanitizer
uses: addnab/docker-run-action@v3
with:
registry: gcr.io
image: ghcr.io/markusjx/node-java-bridge/java-bridge-asan-testcontainer:latest
options: -v ${{ github.workspace }}:/app -e INCREASE_TIMEOUT=true
run: |
npm run build:napi:debug -- --target=x86_64-unknown-linux-gnu \
--cargo-flags="-Zbuild-std"
npm run build:ts
npm run mocha -- --timeout 10000
- name: Create test summary
uses: test-summary/action@dist
if: always()
with:
show: all
paths: testResults.xml
- name: Move target back
run: |
sudo rm -rf target
mv target.bak target
sudo rm -rf test/javaDefinitions