|
| 1 | +# |
| 2 | +# Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved. |
| 3 | +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
| 4 | +# |
| 5 | +# The Universal Permissive License (UPL), Version 1.0 |
| 6 | +# |
| 7 | +# Subject to the condition set forth below, permission is hereby granted to any |
| 8 | +# person obtaining a copy of this software, associated documentation and/or |
| 9 | +# data (collectively the "Software"), free of charge and under any and all |
| 10 | +# copyright rights in the Software, and any and all patent rights owned or |
| 11 | +# freely licensable by each licensor hereunder covering either (i) the |
| 12 | +# unmodified Software as contributed to or provided by such licensor, or (ii) |
| 13 | +# the Larger Works (as defined below), to deal in both |
| 14 | +# |
| 15 | +# (a) the Software, and |
| 16 | +# |
| 17 | +# (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if |
| 18 | +# one is included with the Software each a "Larger Work" to which the Software |
| 19 | +# is contributed by such licensors), |
| 20 | +# |
| 21 | +# without restriction, including without limitation the rights to copy, create |
| 22 | +# derivative works of, display, perform, and distribute the Software and make, |
| 23 | +# use, sell, offer for sale, import, export, have made, and have sold the |
| 24 | +# Software and the Larger Work(s), and to sublicense the foregoing rights on |
| 25 | +# either these or other terms. |
| 26 | +# |
| 27 | +# This license is subject to the following condition: |
| 28 | +# |
| 29 | +# The above copyright notice and either this complete permission notice or at a |
| 30 | +# minimum a reference to the UPL must be included in all copies or substantial |
| 31 | +# portions of the Software. |
| 32 | +# |
| 33 | +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 34 | +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 35 | +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 36 | +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 37 | +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 38 | +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 39 | +# SOFTWARE. |
| 40 | +# |
| 41 | +on: |
| 42 | + workflow_call: |
| 43 | + inputs: |
| 44 | + NATIVE_IMAGE_OPTIONS: |
| 45 | + required: false |
| 46 | + type: string |
| 47 | + |
| 48 | +env: |
| 49 | + COMMON_MAVEN_ARGS: "-e -B --settings .github/mvn-settings.xml --fail-at-end" |
| 50 | + DB_NAME: hibernate_orm_test |
| 51 | + DB_PASSWORD: hibernate_orm_test |
| 52 | + DB_USER: hibernate_orm_test |
| 53 | + NATIVE_TEST_MAVEN_ARGS: "-Dtest-containers -Dstart-containers -Dquarkus.native.native-image-xmx=6g -Dnative -Dnative.surefire.skip -Dformat.skip -Dno-descriptor-tests install -DskipDocs -Dquarkus.native.container-build=false" |
| 54 | + QUARKUS_JAVA_VERSION: 17 # Use Java 17 to build Quarkus as that's the lowest supported JDK version currently |
| 55 | + QUARKUS_PATH: ${{ github.workspace }}/quarkus |
| 56 | + |
| 57 | +name: Weekly Quarkus Tests |
| 58 | + |
| 59 | +permissions: {} |
| 60 | +jobs: |
| 61 | + build-quarkus-and-graalvm: |
| 62 | + permissions: |
| 63 | + contents: read # to fetch code (actions/checkout) |
| 64 | + |
| 65 | + name: Nightly Quarkus and GraalVM build${{ inputs.NATIVE_IMAGE_OPTIONS && format(' ({0})', inputs.NATIVE_IMAGE_OPTIONS) || '' }} |
| 66 | + runs-on: ubuntu-22.04 |
| 67 | + if: (github.event_name == 'schedule' && github.repository == 'oracle/graal') || (github.event_name != 'schedule') |
| 68 | + outputs: |
| 69 | + matrix: ${{ steps.read.outputs.matrix }} |
| 70 | + steps: |
| 71 | + - name: Checkout oracle/graal |
| 72 | + uses: actions/checkout@v4 |
| 73 | + - name: Build GraalVM JDK |
| 74 | + uses: ./.github/actions/build-graalvm |
| 75 | + with: |
| 76 | + java-version: ${{ env.QUARKUS_JAVA_VERSION }} |
| 77 | + - name: Get latest Quarkus release |
| 78 | + run: | |
| 79 | + export QUARKUS_VERSION=main #$(curl https://repo1.maven.org/maven2/io/quarkus/quarkus-bom/maven-metadata.xml | awk -F"[<>]" '/latest/ {print $3}') |
| 80 | + echo Getting Quarkus $QUARKUS_VERSION |
| 81 | + curl --output quarkus.tgz -sL https://api.github.com/repos/quarkusio/quarkus/tarball/$QUARKUS_VERSION |
| 82 | + mkdir ${QUARKUS_PATH} |
| 83 | + tar xf quarkus.tgz -C ${QUARKUS_PATH} --strip-components=1 |
| 84 | + - uses: actions/cache@v4 |
| 85 | + with: |
| 86 | + path: ~/.m2/repository |
| 87 | + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} |
| 88 | + restore-keys: | |
| 89 | + ${{ runner.os }}-maven- |
| 90 | + - name: Tar GraalVM JDK |
| 91 | + shell: bash |
| 92 | + run: tar -czvhf graalvm.tgz -C $(dirname ${GRAALVM_HOME}) $(basename ${GRAALVM_HOME}) |
| 93 | + - name: Persist GraalVM JDK build |
| 94 | + uses: actions/upload-artifact@v4 |
| 95 | + with: |
| 96 | + name: graalvm |
| 97 | + path: graalvm.tgz |
| 98 | + - name: Build Quarkus |
| 99 | + run: | |
| 100 | + cd ${QUARKUS_PATH} |
| 101 | + eval ./mvnw -e -B -Dquickly |
| 102 | + - name: Read json file with native-tests matrix |
| 103 | + id: read |
| 104 | + run: | |
| 105 | + json=$(tr -d '\n' < ${QUARKUS_PATH}/.github/native-tests.json ) |
| 106 | + echo $json |
| 107 | + echo "matrix=${json}" >> $GITHUB_OUTPUT |
| 108 | + - name: Tar Maven Repo |
| 109 | + shell: bash |
| 110 | + run: tar -czvf maven-repo.tgz -C ~ .m2/repository |
| 111 | + - name: Persist Maven Repo |
| 112 | + uses: actions/upload-artifact@v4 |
| 113 | + with: |
| 114 | + name: maven-repo |
| 115 | + path: maven-repo.tgz |
| 116 | + |
| 117 | + native-tests: |
| 118 | + name: Native Tests - ${{matrix.category}}${{ inputs.NATIVE_IMAGE_OPTIONS && format(' with options ({0})', inputs.NATIVE_IMAGE_OPTIONS) || '' }} |
| 119 | + needs: build-quarkus-and-graalvm |
| 120 | + runs-on: ubuntu-latest |
| 121 | + env: |
| 122 | + GRAALVM_HOME: ${{ github.workspace }}/graalvm # identical to the one in ./.github/actions/build-graalvm |
| 123 | + # Ignore the following YAML Schema error |
| 124 | + timeout-minutes: ${{matrix.timeout}} |
| 125 | + strategy: |
| 126 | + max-parallel: 8 |
| 127 | + fail-fast: false |
| 128 | + matrix: ${{ fromJson(needs.build-quarkus-and-graalvm.outputs.matrix) }} |
| 129 | + steps: |
| 130 | + - name: Download GraalVM JDK build |
| 131 | + if: startsWith(matrix.os-name, 'ubuntu') |
| 132 | + uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1 |
| 133 | + with: |
| 134 | + name: graalvm |
| 135 | + path: . |
| 136 | + - name: Extract GraalVM JDK build |
| 137 | + if: startsWith(matrix.os-name, 'ubuntu') |
| 138 | + shell: bash |
| 139 | + run: tar -xzvf graalvm.tgz -C $(dirname ${GRAALVM_HOME}) |
| 140 | + - name: Get latest Quarkus release |
| 141 | + if: startsWith(matrix.os-name, 'ubuntu') |
| 142 | + run: | |
| 143 | + export QUARKUS_VERSION=main #$(curl https://repo1.maven.org/maven2/io/quarkus/quarkus-bom/maven-metadata.xml | awk -F"[<>]" '/latest/ {print $3}') |
| 144 | + echo Getting Quarkus $QUARKUS_VERSION |
| 145 | + curl --output quarkus.tgz -sL https://api.github.com/repos/quarkusio/quarkus/tarball/$QUARKUS_VERSION |
| 146 | + mkdir ${QUARKUS_PATH} |
| 147 | + tar xf quarkus.tgz -C ${QUARKUS_PATH} --strip-components=1 |
| 148 | + - name: Reclaim Disk Space |
| 149 | + if: startsWith(matrix.os-name, 'ubuntu') |
| 150 | + run: ${QUARKUS_PATH}/.github/ci-prerequisites.sh |
| 151 | + - name: Download Maven Repo |
| 152 | + if: startsWith(matrix.os-name, 'ubuntu') |
| 153 | + uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1 |
| 154 | + with: |
| 155 | + name: maven-repo |
| 156 | + path: . |
| 157 | + - name: Extract Maven Repo |
| 158 | + if: startsWith(matrix.os-name, 'ubuntu') |
| 159 | + shell: bash |
| 160 | + run: tar -xzf maven-repo.tgz -C ~ |
| 161 | + - uses: actions/setup-java@v4 |
| 162 | + with: |
| 163 | + distribution: 'oracle' |
| 164 | + java-version: '17' |
| 165 | + - name: Build with Maven |
| 166 | + if: startsWith(matrix.os-name, 'ubuntu') |
| 167 | + env: |
| 168 | + TEST_MODULES: ${{matrix.test-modules}} |
| 169 | + run: | |
| 170 | + cd ${QUARKUS_PATH} |
| 171 | + ${GRAALVM_HOME}/bin/native-image --version |
| 172 | + ./mvnw $COMMON_MAVEN_ARGS -f integration-tests -pl "$TEST_MODULES" $NATIVE_TEST_MAVEN_ARGS |
| 173 | + - name: Prepare failure archive (if maven failed) |
| 174 | + if: failure() |
| 175 | + shell: bash |
| 176 | + run: find . -type d -name '*-reports' -o -wholename '*/build/reports/tests/functionalTest' | tar -czf test-reports.tgz -T - |
| 177 | + - name: Upload failure Archive (if maven failed) |
| 178 | + uses: actions/upload-artifact@v4 |
| 179 | + if: failure() |
| 180 | + with: |
| 181 | + name: test-reports-native-${{matrix.category}} |
| 182 | + path: 'test-reports.tgz' |
0 commit comments