Skip to content

Commit

Permalink
re-enable native builds
Browse files Browse the repository at this point in the history
  • Loading branch information
mmoayyed committed Dec 19, 2023
1 parent fd9b5f0 commit 705eecc
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 16 deletions.
21 changes: 14 additions & 7 deletions .github/workflows/initializr-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Initializr Native Image
env:
TERM: xterm-256color
JDK_CURRENT: 17
JDK_DISTRO: 'corretto'
GH_TOKEN: ${{ secrets.GH_TOKEN }}

##########################################################################
Expand Down Expand Up @@ -78,12 +79,24 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v4
if: ${{ matrix.versions.sync == true && matrix.versions.branch == 'master' }}
- name: Set up JDK
uses: actions/[email protected]
if: ${{ matrix.versions.sync == true && matrix.versions.branch == 'master' }}
with:
java-version: ${{ env.JDK_CURRENT }}
distribution: ${{ env.JDK_DISTRO }}
- name: Validate Initializr
if: ${{ matrix.versions.sync == true && matrix.versions.branch == 'master' }}
run: ./ci/validate-initializr.sh
- name: Fetch Overlay
if: ${{ matrix.versions.sync == true && matrix.versions.branch == 'master' }}
run: ./ci/validate-cas-native.sh --fetch-only --cas ${{ matrix.versions.version }}
- name: Setup GraalVM JDK
uses: graalvm/setup-graalvm@v1
if: ${{ matrix.versions.sync == true && matrix.versions.branch == 'master' }}
with:
distribution: 'graalvm'
java-version: ${{ env.JDK_CURRENT }}
java-version: ${{ matrix.versions.java-version }}
github-token: ${{ secrets.GITHUB_TOKEN }}
cache: 'gradle'
set-java-home: 'true'
Expand All @@ -95,12 +108,6 @@ jobs:
echo "JAVA_HOME: $JAVA_HOME"
java --version
native-image --version
- name: Build Initializr
if: ${{ matrix.versions.sync == true && matrix.versions.branch == 'master' }}
run: ./gradlew --build-cache --configure-on-demand --no-daemon clean build -x test -x javadoc -x check --parallel
- name: Validate Initializr
if: ${{ matrix.versions.sync == true && matrix.versions.branch == 'master' }}
run: ./ci/validate-initializr.sh
- name: Build Native Image
timeout-minutes: 35
if: ${{ matrix.versions.sync == true && matrix.versions.branch == 'master' }}
Expand Down
29 changes: 20 additions & 9 deletions ci/validate-cas-native.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,40 @@

source ./ci/functions.sh

FETCH_OVERLAY="false"
while (( "$#" )); do
case "$1" in
--fetch-only)
FETCH_OVERLAY="true"
shift 1
;;
--cas)
CAS_VERSION="$2"
shift 2
;;
esac
done

parameters="casVersion=${CAS_VERSION}&nativeImageSupported=true"

CAS_MAJOR_VERSION=`echo $CAS_VERSION | cut -d. -f1`
CAS_MINOR_VERSION=`echo $CAS_VERSION | cut -d. -f2`

java -jar app/build/libs/app.jar &
pid=$!
sleep 15
if [[ "${FETCH_OVERLAY}" == "true" ]]; then
parameters="casVersion=${CAS_VERSION}&nativeImageSupported=true"
java -jar app/build/libs/app.jar &
pid=$!
sleep 15
printgreen "Requesting CAS overlay for ${parameters}"
curl http://localhost:8080/starter.tgz --connect-timeout 30 -d "${parameters}" | tar -xzvf -
kill -9 $pid
[ "$CI" = "true" ] && pkill java
ls
printgreen "Downloaded CAS overlay ${CAS_VERSION} successfully."
exit 0
fi

mkdir tmp
cd tmp || exit
printgreen "Requesting CAS overlay for ${parameters}"
curl http://localhost:8080/starter.tgz --connect-timeout 30 -d "${parameters}" | tar -xzvf -
kill -9 $pid
[ "$CI" = "true" ] && pkill java
echo "Working directory: ${PWD}"

if [[ -d /tmp ]] ; then
sudo mkdir /tmp
Expand Down

0 comments on commit 705eecc

Please sign in to comment.