re-enable native builds #116
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: 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: 17 | |
JDK_DISTRO: 'corretto' | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
########################################################################## | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
schedule: | |
- cron: '0 0 * * *' | |
########################################################################## | |
jobs: | |
cancel-previous-runs: | |
runs-on: ubuntu-latest | |
timeout-minutes: 1 | |
steps: | |
- uses: styfle/[email protected] | |
with: | |
access_token: ${{ github.token }} | |
########################################################################## | |
initialize: | |
runs-on: macos-latest | |
needs: [cancel-previous-runs] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/[email protected] | |
with: | |
java-version: ${{ env.JDK_CURRENT }} | |
distribution: 'temurin' | |
- name: Setup Gradle Wrapper Cache | |
uses: actions/cache@v3 | |
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: macos-latest | |
outputs: | |
supported-versions: ${{ steps.get-supported-versions.outputs.supported-versions }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/[email protected] | |
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: macos-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/[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: ${{ 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: 35 | |
if: ${{ matrix.versions.sync == true && matrix.versions.branch == 'master' }} | |
run: ./ci/validate-cas-native.sh --cas ${{ matrix.versions.version }} |