chore: add missing java versions (#108) #211
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |