build: patch tree-sitter library lookup #73
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: CI | |
on: | |
push: | |
branches: [master] | |
paths: | |
- pom.xml | |
- src/** | |
pull_request: | |
branches: [master] | |
paths: | |
- pom.xml | |
- src/** | |
concurrency: | |
cancel-in-progress: true | |
group: ${{github.workflow}}-${{github.ref_name}} | |
permissions: | |
contents: write | |
security-events: write | |
jobs: | |
test: | |
name: Test package | |
runs-on: ubuntu-latest | |
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 | |
run: printf 'TREE_SITTER_REF=%s\n' "$(git rev-parse HEAD:core)" >> "$GITHUB_ENV" | |
- name: Set up tree-sitter | |
uses: tree-sitter/setup-action/lib@v2 | |
with: | |
tree-sitter-ref: ${{env.TREE_SITTER_REF}} | |
- name: Set up tree-sitter-java | |
run: |- | |
git clone --depth=1 https://github.com/tree-sitter/tree-sitter-java | |
make -Ctree-sitter-java all install PREFIX="$RUNNER_TOOL_CACHE/tree-sitter/lib" | |
- name: Set up jextract | |
run: |- | |
curl -LSs '${{env.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/5/openjdk-22-jextract+5-33_linux-x64_bin.tar.gz | |
- 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 |