Skip to content

Initializr Native Image #615

Initializr Native Image

Initializr Native Image #615

name: Initializr Native Image
env:
JAVA_OPTS: "-Xms512m -Xmx6048m -Xss128m -XX:ReservedCodeCacheSize=512m -server"
GRADLE_OPTS: "-Xms512m -Xmx6048m -Xss128m -XX:ReservedCodeCacheSize=512m -server"
TERM: xterm-256color
JDK_CURRENT: 21
JDK_DISTRO: 'corretto'
GH_TOKEN: ${{ secrets.GH_TOKEN }}
CAS_MODULE_METADATA_MONGODB_URL: ${{ secrets.CAS_MODULE_METADATA_MONGODB_URL }}
##########################################################################
on:
workflow_dispatch:
push:
branches: [ master ]
pull_request:
branches: [ master ]
schedule:
- cron: '0 0 * * *'
concurrency:
group: "workflow = ${{ github.workflow }}, ref = ${{ github.event.ref }}, pr = ${{ github.event.pull_request.id }}"
cancel-in-progress: ${{ github.event_name == 'pull_request' || github.repository != 'apereo/cas-initializr' }}
##########################################################################
jobs:
initialize:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: ${{ env.JDK_CURRENT }}
distribution: 'temurin'
- name: Setup Gradle Wrapper Cache
uses: actions/cache@v4
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-${{ github.sha }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
- name: Initialize
run: ls ./ci && find ./ci -type f -name "*.sh" -exec chmod +x "{}" \;
##########################################################################
supported-versions-cas:
needs: [ initialize ]
runs-on: ubuntu-latest
outputs:
supported-versions: ${{ steps.get-supported-versions.outputs.supported-versions }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: ${{ env.JDK_CURRENT }}
distribution: 'zulu'
- id: print-supported-versions
name: Print supported versions
run: ./gradlew --no-daemon -q versions-cas
- id: get-supported-versions
name: Get supported versions for matrix
run: echo "supported-versions=$(./gradlew --no-daemon -q versions-cas)" >> $GITHUB_OUTPUT
build:
runs-on: ubuntu-latest
needs: [ supported-versions-cas ]
continue-on-error: false
strategy:
matrix:
versions: ${{fromJSON(needs.supported-versions-cas.outputs.supported-versions)}}
name: CAS Native Image ${{ matrix.versions.version }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
if: ${{ matrix.versions.sync == true && matrix.versions.branch == 'master' }}
- name: Set up JDK
uses: actions/setup-java@v4
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: ${{ matrix.versions.java-version }}
github-token: ${{ secrets.GITHUB_TOKEN }}
cache: 'gradle'
set-java-home: 'true'
native-image-job-reports: 'true'
- name: GraalVM Versions
if: ${{ matrix.versions.sync == true && matrix.versions.branch == 'master' }}
run: |
echo "GRAALVM_HOME: $GRAALVM_HOME"
echo "JAVA_HOME: $JAVA_HOME"
java --version
native-image --version
- name: Build Native Image
timeout-minutes: 45
if: ${{ matrix.versions.sync == true && matrix.versions.branch == 'master' }}
run: ./ci/validate-cas-native.sh --cas ${{ matrix.versions.version }}