ci(publish): update workflow #237
Workflow file for this run
This file contains hidden or 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: | |
| env: | |
| JAVA_VERSION: 21 | |
| NODE_VERSION: 24 | |
| 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@v6 | |
| - 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@v6 | |
| - name: Setup node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{env.NODE_VERSION}} | |
| check-latest: true | |
| cache: 'npm' | |
| - name: Setup java | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'temurin' | |
| java-version: ${{env.JAVA_VERSION}} | |
| - name: Rust Cache | |
| uses: Swatinem/rust-cache@v2.7.3 | |
| - 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 |