Skip to content

Split the bindings for TSQuery and TSQueryCursor into multiple classes #93

Split the bindings for TSQuery and TSQueryCursor into multiple classes

Split the bindings for TSQuery and TSQueryCursor into multiple classes #93

Workflow file for this run

name: CI
on:
push:
branches: [master]
paths:
- pom.xml
- src/**
- .github/workflows/ci.yml
pull_request:
branches: [master]
paths:
- pom.xml
- src/**
- .github/workflows/ci.yml
concurrency:
cancel-in-progress: true
group: ${{github.workflow}}-${{github.ref_name}}
permissions:
contents: write
security-events: write
jobs:
test:
name: Test package
strategy:
fail-fast: false
matrix:
target: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{matrix.target}}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 22
cache: maven
- name: Get tree-sitter commit
shell: sh
run: printf 'TREE_SITTER_REF=%s\n' "$(git rev-parse HEAD:core)" >> "$GITHUB_ENV"
- name: Set up tree-sitter CLI
if: runner.os == 'Windows'
uses: tree-sitter/setup-action/cli@v2
- name: Set up tree-sitter library
uses: tree-sitter/setup-action/lib@v2
with:
tree-sitter-ref: ${{env.TREE_SITTER_REF}}
- name: Set up tree-sitter-java
shell: bash
run: |-
git clone --depth=1 https://github.com/tree-sitter/tree-sitter-java
cd tree-sitter-java
cmake -B build \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_INSTALL_BINDIR=lib \
-DCMAKE_INSTALL_PREFIX="$RUNNER_TOOL_CACHE/tree-sitter/lib"
cmake --build build && cmake --install build --config Debug
- name: Set up jextract
shell: bash
run: |-
if [[ $RUNNER_OS == Linux ]]; then
JEXTRACT_URL+=_linux-x64_bin.tar.gz
elif [[ $RUNNER_OS == macOS ]]; then
JEXTRACT_URL+=_macos-aarch64_bin.tar.gz
else
JEXTRACT_URL+=_windows-x64_bin.tar.gz
fi
curl -LSs "$JEXTRACT_URL" | tar xzf - -C "$RUNNER_TOOL_CACHE"
printf '%s/jextract-22/bin\n' "$RUNNER_TOOL_CACHE" >> "$GITHUB_PATH"
env:
# NOTE: keep this in sync with deploy, docs
JEXTRACT_URL: https://download.java.net/java/early_access/jextract/22/6/openjdk-22-jextract+6-47
- name: Run tests
run: mvn --no-transfer-progress test
- name: Patch SpotBugs SARIF report
if: "!cancelled() && github.event_name == 'push'"
run: mvn antrun:run@patch-sarif
- name: Upload SpotBugs SARIF report
uses: github/codeql-action/upload-sarif@v3
if: "!cancelled() && github.event_name == 'push'"
with:
category: spotbugs
sarif_file: target/reports/spotbugsSarif.json
- name: Upload JUnit XML report
uses: mikepenz/action-junit-report@v5
if: "!cancelled()"
with:
annotate_only: true
detailed_summary: true
report_paths: target/reports/surefire/TEST-*.xml