Skip to content

Commit

Permalink
Install jextract with SDKMAN
Browse files Browse the repository at this point in the history
  • Loading branch information
mk868 committed Dec 14, 2024
1 parent e25a9f7 commit 0ba07ef
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 33 deletions.
29 changes: 10 additions & 19 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,11 @@ jobs:
distribution: 'temurin'
cache: maven

- name: Cache jextract
id: cache-jextract
uses: actions/cache@v4
- uses: sdkman/sdkman-action@v1
id: sdkman
with:
path: jextract
key: 22-jextract+5-33

- name: Set up jextract
if: steps.cache-jextract.outputs.cache-hit != 'true'
run: ./prepare-jextract.sh
candidate: jextract
version: 22.ea.6

- name: Check sources with Maven
run: |
Expand All @@ -39,15 +34,10 @@ jobs:
- name: Build with Maven
run: |
./prepare.sh
mvn -B -ntp -f jgpio/pom.xml install -Djextract.bin=../jextract/bin/jextract
mvn -B -ntp -f jgpio/pom.xml install
mvn -B -ntp -f jgpio-it/pom.xml package
mvn -B -ntp -f examples/pom.xml package
- uses: actions/upload-artifact@v4
with:
name: jgpio-target
path: jgpio/target

test-it:
needs: build
runs-on: self-hosted
Expand All @@ -61,12 +51,13 @@ jobs:
distribution: 'temurin'
cache: maven

- uses: actions/download-artifact@v4
- uses: sdkman/sdkman-action@v1
id: sdkman
with:
name: jgpio-target
path: jgpio/target
candidate: jextract
version: 22.ea.6

- name: Test IT
run: |
mvn -B -ntp -f jgpio/pom.xml jar:jar install:install
mvn -B -ntp -f jgpio/pom.xml install
mvn -B -ntp -f jgpio-it/pom.xml verify
15 changes: 1 addition & 14 deletions prepare-jextract.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
#!/bin/bash

function get_jextract() {
file=openjdk-22-jextract+5-33_linux-x64_bin.tar.gz
jextract_dir=jextract
if [ -d "$jextract_dir" ] ; then
echo "$jextract_dir already exist, skipping"
exit 0
fi
curl -O https://download.java.net/java/early_access/jextract/22/5/"$file"
tar -xf "$file"
rm -fv "$file"
mv -v jextract-22 "$jextract_dir"
}

get_jextract
sdk install jextract 22.ea.6

echo "Done"

0 comments on commit 0ba07ef

Please sign in to comment.