Skip to content

Commit

Permalink
Only do container/native builds if jvm passes
Browse files Browse the repository at this point in the history
  • Loading branch information
edeandrea authored Nov 8, 2024
1 parent 7e0d9a8 commit 652a53f
Showing 1 changed file with 26 additions and 72 deletions.
98 changes: 26 additions & 72 deletions .github/workflows/simple-build-test.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
name: Basic build and test

env:
MANDREL_VERSION: "23.1.2.0"

on:
push:
paths-ignore:
Expand Down Expand Up @@ -105,6 +102,7 @@ jobs:
jvm-container-build-test:
runs-on: ubuntu-latest
if: github.repository == 'quarkusio/quarkus-super-heroes'
needs: jvm-build-test
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -148,6 +146,7 @@ jobs:
jvm-container-build:
runs-on: ubuntu-latest
if: github.repository == 'quarkusio/quarkus-super-heroes'
needs: jvm-build-test
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -178,6 +177,7 @@ jobs:
native-build-test:
runs-on: ubuntu-latest
if: github.repository == 'quarkusio/quarkus-super-heroes'
needs: jvm-build-test
strategy:
fail-fast: false
matrix:
Expand All @@ -196,30 +196,14 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Get Mandrel file name
run: echo "MANDREL_FILE=mandrel-java${{ matrix.java.mandrel }}-linux-amd64-${{ env.MANDREL_VERSION }}-Final.tar.gz" >> $GITHUB_ENV

- name: Cache and restore Mandrel distro
id: check-mandrel-cache
uses: actions/cache@v4
- name: Setup GraalVM
uses: graalvm/setup-graalvm@v1
with:
path: ${{ env.MANDREL_FILE }}
key: mandrel-distro-${{ env.MANDREL_VERSION }}

- name: Download Mandrel
if: steps.check-mandrel-cache.outputs.cache-hit != 'true'
run: |
download_url="https://github.com/graalvm/mandrel/releases/download/mandrel-${{ env.MANDREL_VERSION }}-Final/${{ env.MANDREL_FILE }}"
wget -q -O ${{ env.MANDREL_FILE }} $download_url
- name: Setup Maven+OpenJDK Distro
uses: actions/setup-java@v4
with:
distribution: 'jdkfile'
jdkFile: ${{ env.MANDREL_FILE }}
java-version: ${{ matrix.java.jvm }}
architecture: x64
cache: maven
java-version: '${{ matrix.java.mandrel }}'
distribution: 'mandrel'
cache: 'maven'
native-image-job-reports: 'true'
native-image-pr-reports: 'true'

- name: Create env vars
if: matrix.project.openai-type
Expand All @@ -238,6 +222,7 @@ jobs:
native-container-build-test:
runs-on: ubuntu-latest
if: github.repository == 'quarkusio/quarkus-super-heroes'
needs: jvm-build-test
strategy:
fail-fast: false
matrix:
Expand All @@ -254,30 +239,14 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Get Mandrel file name
run: echo "MANDREL_FILE=mandrel-java${{ matrix.java.mandrel }}-linux-amd64-${{ env.MANDREL_VERSION }}-Final.tar.gz" >> $GITHUB_ENV

- name: Cache and restore Mandrel distro
id: check-mandrel-cache
uses: actions/cache@v4
with:
path: ${{ env.MANDREL_FILE }}
key: mandrel-distro-${{ env.MANDREL_VERSION }}

- name: Download Mandrel
if: steps.check-mandrel-cache.outputs.cache-hit != 'true'
run: |
download_url="https://github.com/graalvm/mandrel/releases/download/mandrel-${{ env.MANDREL_VERSION }}-Final/${{ env.MANDREL_FILE }}"
wget -q -O ${{ env.MANDREL_FILE }} $download_url
- name: Setup Maven+OpenJDK Distro
uses: actions/setup-java@v4
- name: Setup GraalVM
uses: graalvm/setup-graalvm@v1
with:
distribution: 'jdkfile'
jdkFile: ${{ env.MANDREL_FILE }}
java-version: ${{ matrix.java.jvm }}
architecture: x64
cache: maven
java-version: '${{ matrix.java.mandrel }}'
distribution: 'mandrel'
cache: 'maven'
native-image-job-reports: 'true'
native-image-pr-reports: 'true'

- name: Create env vars
if: matrix.project.openai-type
Expand All @@ -300,6 +269,7 @@ jobs:
native-container-build:
runs-on: ubuntu-latest
if: github.repository == 'quarkusio/quarkus-super-heroes'
needs: jvm-build-test
strategy:
fail-fast: false
matrix:
Expand All @@ -312,30 +282,14 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Get Mandrel file name
run: echo "MANDREL_FILE=mandrel-java${{ matrix.java.mandrel }}-linux-amd64-${{ env.MANDREL_VERSION }}-Final.tar.gz" >> $GITHUB_ENV

- name: Cache and restore Mandrel distro
id: check-mandrel-cache
uses: actions/cache@v4
- name: Setup GraalVM
uses: graalvm/setup-graalvm@v1
with:
path: ${{ env.MANDREL_FILE }}
key: mandrel-distro-${{ env.MANDREL_VERSION }}

- name: Download Mandrel
if: steps.check-mandrel-cache.outputs.cache-hit != 'true'
run: |
download_url="https://github.com/graalvm/mandrel/releases/download/mandrel-${{ env.MANDREL_VERSION }}-Final/${{ env.MANDREL_FILE }}"
wget -q -O ${{ env.MANDREL_FILE }} $download_url
- name: Setup Maven+OpenJDK Distro
uses: actions/setup-java@v4
with:
distribution: 'jdkfile'
jdkFile: ${{ env.MANDREL_FILE }}
java-version: ${{ matrix.java.jvm }}
architecture: x64
cache: maven
java-version: '${{ matrix.java.mandrel }}'
distribution: 'mandrel'
cache: 'maven'
native-image-job-reports: 'true'
native-image-pr-reports: 'true'

- name: "build-native-container-${{ matrix.project }}-java-${{ matrix.java.jvm }}"
working-directory: ${{ matrix.project }}
Expand Down

0 comments on commit 652a53f

Please sign in to comment.