|
8 | 8 | runs-on: ubuntu-latest |
9 | 9 |
|
10 | 10 | steps: |
11 | | - - uses: actions/checkout@v3 |
12 | | - |
| 11 | + - name: Checkout |
| 12 | + uses: actions/checkout@v3 |
13 | 13 | - name: Setup node |
14 | 14 | uses: actions/setup-node@v3.6.0 |
15 | 15 | with: |
16 | 16 | node-version: 18 |
17 | 17 | check-latest: true |
18 | 18 | cache: 'npm' |
| 19 | + - name: Setup java 17 |
| 20 | + uses: actions/setup-java@v3 |
| 21 | + with: |
| 22 | + distribution: 'temurin' |
| 23 | + java-version: '17' |
| 24 | + |
| 25 | + - name: Rust Cache |
| 26 | + uses: Swatinem/rust-cache@v2.2.1 |
| 27 | + - name: Cache java definitions |
| 28 | + uses: actions/cache@v3 |
| 29 | + with: |
| 30 | + path: '**/test/javaDefinitions' |
| 31 | + key: ${{runner.os}}-javaDefinitions |
19 | 32 |
|
20 | 33 | - name: Install dependencies |
21 | 34 | run: npm ci |
| 35 | + - name: Build |
| 36 | + run: npm run build |
| 37 | + - name: Generate test types |
| 38 | + run: npm run generateTestTypes -- --system-test |
| 39 | + - name: Remove target and dist directories |
| 40 | + run: | |
| 41 | + rm -rf dist |
| 42 | + mv target target.bak |
| 43 | + cp -r test/javaDefinitions javaDefinitions.bak |
22 | 44 |
|
23 | 45 | - name: Run tests with address sanitizer |
24 | 46 | uses: addnab/docker-run-action@v3 |
25 | 47 | with: |
26 | 48 | registry: gcr.io |
27 | | - image: ghcr.io/markusjx/prebuilt-debug-jdk:17-bullseye |
| 49 | + image: ghcr.io/markusjx/node-java-bridge/java-bridge-asan-testcontainer:latest |
28 | 50 | options: -v ${{ github.workspace }}:/app |
29 | 51 | run: | |
30 | | - curl -fsSL https://deb.nodesource.com/setup_18.x | bash - >> /dev/null |
31 | | - apt-get install -yqq nodejs |
32 | | - cargo update |
33 | 52 | npm run build:napi:debug -- --target=x86_64-unknown-linux-gnu \ |
34 | 53 | --cargo-flags="-Zbuild-std" |
35 | | - npm run postbuild |
| 54 | + npm run build:ts |
| 55 | + npm run generateTestTypes -- --update-imports |
| 56 | + npm run mocha -- --timeout 10000 |
36 | 57 |
|
37 | | - export LD_PRELOAD=$(clang -print-file-name=libclang_rt.asan-x86_64.so) |
38 | | - export RUST_BACKTRACE=1 |
39 | | - export FORCE_RUN_ALL_TESTS=true |
40 | | - export INCREASE_TIMEOUT=true |
41 | | - export SKIP_CLASS_TEST=true |
42 | | - export DEBUG='napi:*' |
43 | | - npm run testOnly |
| 58 | + - name: Create test summary |
| 59 | + uses: test-summary/action@dist |
| 60 | + if: always() |
| 61 | + with: |
| 62 | + show: all |
| 63 | + paths: testResults.xml |
| 64 | + - name: Move target back |
| 65 | + run: | |
| 66 | + sudo rm -rf target |
| 67 | + mv target.bak target |
| 68 | + sudo rm -rf test/javaDefinitions |
| 69 | + mv javaDefinitions.bak test/javaDefinitions |
0 commit comments