Skip to content

Commit

Permalink
ci: run on every OS
Browse files Browse the repository at this point in the history
and update jextract
  • Loading branch information
ObserverOfTime committed Dec 8, 2024
1 parent 8a82661 commit 7369f7f
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 7 deletions.
35 changes: 30 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ on:
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
Expand All @@ -23,7 +25,11 @@ permissions:
jobs:
test:
name: Test package
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{matrix.target}}
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -36,22 +42,41 @@ jobs:
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
- 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
make -Ctree-sitter-java all install PREFIX="$RUNNER_TOOL_CACHE/tree-sitter/lib"
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: |-
curl -LSs '${{env.JEXTRACT_URL}}' | tar xzf - -C "$RUNNER_TOOL_CACHE"
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/5/openjdk-22-jextract+5-33_linux-x64_bin.tar.gz
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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
printf '%s/jextract-22/bin\n' "$RUNNER_TOOL_CACHE" >> "$GITHUB_PATH"
env:
# NOTE: keep this in sync with ci, docs
JEXTRACT_URL: https://download.java.net/java/early_access/jextract/22/5/openjdk-22-jextract+5-33_linux-x64_bin.tar.gz
JEXTRACT_URL: https://download.java.net/java/early_access/jextract/22/6/openjdk-22-jextract+6-47_linux-x64_bin.tar.gz
- name: Deploy to Maven Central
run: mvn --no-transfer-progress deploy -Dspotbugs.skip=true
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
printf '%s/jextract-22/bin\n' "$RUNNER_TOOL_CACHE" >> "$GITHUB_PATH"
env:
# NOTE: keep this in sync with ci, deploy
JEXTRACT_URL: https://download.java.net/java/early_access/jextract/22/5/openjdk-22-jextract+5-33_linux-x64_bin.tar.gz
JEXTRACT_URL: https://download.java.net/java/early_access/jextract/22/6/openjdk-22-jextract+6-47_linux-x64_bin.tar.gz
- name: Build javadoc
run: mvn --no-transfer-progress javadoc:javadoc antrun:run@fix-javadoc
- name: Upload pages artifact
Expand Down

0 comments on commit 7369f7f

Please sign in to comment.