From bbd388f0ddd5a0f1bd3438addb120712acb77002 Mon Sep 17 00:00:00 2001 From: Loic Ottet Date: Thu, 12 Sep 2024 11:22:23 +0200 Subject: [PATCH] Run master Github workflows --- .github/actions/build-graalvm/action.yml | 66 ++++++++++ .github/workflows/cdt-inspect.yml | 92 +++++++++++++ .github/workflows/main.yml | 117 +++++++++++++--- .github/workflows/micronaut.yml | 89 +++++++++++++ .github/workflows/quarkus.yml | 113 +++++++++------- .github/workflows/reachability-metadata.yml | 139 ++++++++++++++++++++ .github/workflows/spring.yml | 81 ++++++++++++ 7 files changed, 630 insertions(+), 67 deletions(-) create mode 100644 .github/actions/build-graalvm/action.yml create mode 100644 .github/workflows/cdt-inspect.yml create mode 100644 .github/workflows/micronaut.yml create mode 100644 .github/workflows/reachability-metadata.yml create mode 100644 .github/workflows/spring.yml diff --git a/.github/actions/build-graalvm/action.yml b/.github/actions/build-graalvm/action.yml new file mode 100644 index 000000000000..245aa36cdf12 --- /dev/null +++ b/.github/actions/build-graalvm/action.yml @@ -0,0 +1,66 @@ +name: Build GraalVM JDK +description: 'Build GraalVM JDK and set up environment for testing' + +inputs: + native-images: + description: 'Internal GraalVM native images to build' + required: false + default: 'native-image' + components: + description: 'Internal GraalVM components to build' + required: false + default: 'Native Image' + java-version: + description: 'Java version to use' + required: false + default: '' + +runs: + using: 'composite' + steps: + - name: Set up environment variables + shell: bash + run: | + echo "GRAALVM_HOME=${{ github.workspace }}/graalvm" >> ${GITHUB_ENV} + echo "LABSJDK_HOME=${{ github.workspace }}/labsjdk" >> ${GITHUB_ENV} + echo "MX_GIT_CACHE=refcache" >> ${GITHUB_ENV} + echo "MX_PATH=${{ github.workspace }}/mx" >> ${GITHUB_ENV} + echo "MX_PYTHON=python3.8" >> ${GITHUB_ENV} + echo "MX_VERSION=$(jq -r '.mx_version' common.json)" >> ${GITHUB_ENV} + # Workaround testsuite locale issue + echo "LANG=en_US.UTF-8" >> ${GITHUB_ENV} + - name: Checkout graalvm/mx + uses: actions/checkout@v4 + with: + repository: graalvm/mx + ref: ${{ env.MX_VERSION }} + path: ${{ env.MX_PATH }} + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.8' + - name: Update mx cache + uses: actions/cache@v4 + with: + path: ~/.mx + key: ${{ runner.os }}-mx-${{ hashFiles('**/suite.py') }} + restore-keys: ${{ runner.os }}-mx- + - name: Fetch LabsJDK + shell: bash + run: | + mkdir jdk-dl + ${MX_PATH}/mx --java-home= fetch-jdk --jdk-id labsjdk-ce-21 --to jdk-dl --alias ${LABSJDK_HOME} + - name: Build GraalVM JDK + shell: bash + run: | + cd substratevm + ${MX_PATH}/mx --java-home=${LABSJDK_HOME} --native-images="${{ inputs.native-images }}" --components="${{ inputs.components }}" build + ln -s $(${MX_PATH}/mx --java-home=${LABSJDK_HOME} --native-images="${{ inputs.native-images }}" --components="${{ inputs.components }}" graalvm-home) ${GRAALVM_HOME} + ${GRAALVM_HOME}/bin/native-image --version + - name: Set up JAVA_HOME + if: ${{ inputs.java-version }} != '' + uses: actions/setup-java@v4 + with: + distribution: 'oracle' + java-version: '${{ inputs.java-version }}' + \ No newline at end of file diff --git a/.github/workflows/cdt-inspect.yml b/.github/workflows/cdt-inspect.yml new file mode 100644 index 000000000000..9ea51c7c49de --- /dev/null +++ b/.github/workflows/cdt-inspect.yml @@ -0,0 +1,92 @@ +# +# Copyright (c) 2023, 2023, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# The Universal Permissive License (UPL), Version 1.0 +# +# Subject to the condition set forth below, permission is hereby granted to any +# person obtaining a copy of this software, associated documentation and/or +# data (collectively the "Software"), free of charge and under any and all +# copyright rights in the Software, and any and all patent rights owned or +# freely licensable by each licensor hereunder covering either (i) the +# unmodified Software as contributed to or provided by such licensor, or (ii) +# the Larger Works (as defined below), to deal in both +# +# (a) the Software, and +# +# (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if +# one is included with the Software each a "Larger Work" to which the Software +# is contributed by such licensors), +# +# without restriction, including without limitation the rights to copy, create +# derivative works of, display, perform, and distribute the Software and make, +# use, sell, offer for sale, import, export, have made, and have sold the +# Software and the Larger Work(s), and to sublicense the foregoing rights on +# either these or other terms. +# +# This license is subject to the following condition: +# +# The above copyright notice and either this complete permission notice or at a +# minimum a reference to the UPL must be included in all copies or substantial +# portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +# Intergation test of CDT with Inspector backend. +name: Weekly CDT Inspector + +on: + schedule: + - cron: "30 2 * * 2,5" # Tuesday and Friday at 2:30 + +env: + JAVA_HOME: ${{ github.workspace }}/jdk + JDK_VERSION: "latest" + MX_PATH: ${{ github.workspace }}/mx + SE_SKIP_DRIVER_IN_PATH: "true" + +jobs: + build: + + runs-on: ubuntu-latest + + if: github.repository == 'oracle/graal' + + steps: + - name: Checkout oracle/graal + uses: actions/checkout@v4 + with: + path: ${{ github.workspace }}/graal + - name: Checkout oracle/graaljs + uses: actions/checkout@v4 + with: + repository: oracle/graaljs + sparse-checkout: | + graal-js + path: ${{ github.workspace }}/js + - name: Checkout graalvm/mx + uses: actions/checkout@v4 + with: + repository: graalvm/mx.git + ref: master + path: ${{ env.MX_PATH }} + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.8' + - name: Fetch LabsJDK + run: | + mkdir jdk-dl + ${MX_PATH}/mx --java-home= fetch-jdk --jdk-id labsjdk-ce-${JDK_VERSION} --to jdk-dl --alias ${JAVA_HOME} + - run: | + cd ${{ github.workspace }}/graal/vm + ${MX_PATH}/mx --dy /tools,graal-js build + cd tests/gh_workflows/CDTInspectorTest + mvn -q compile + mvn -q exec:exec -Dtestargs="${{ github.workspace }}/graal/sdk/latest_graalvm_home/bin/js scripts/StepTest.js" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e3449828a294..67e6f60be515 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,3 +1,43 @@ +# +# Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# The Universal Permissive License (UPL), Version 1.0 +# +# Subject to the condition set forth below, permission is hereby granted to any +# person obtaining a copy of this software, associated documentation and/or +# data (collectively the "Software"), free of charge and under any and all +# copyright rights in the Software, and any and all patent rights owned or +# freely licensable by each licensor hereunder covering either (i) the +# unmodified Software as contributed to or provided by such licensor, or (ii) +# the Larger Works (as defined below), to deal in both +# +# (a) the Software, and +# +# (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if +# one is included with the Software each a "Larger Work" to which the Software +# is contributed by such licensors), +# +# without restriction, including without limitation the rights to copy, create +# derivative works of, display, perform, and distribute the Software and make, +# use, sell, offer for sale, import, export, have made, and have sold the +# Software and the Larger Work(s), and to sublicense the foregoing rights on +# either these or other terms. +# +# This license is subject to the following condition: +# +# The above copyright notice and either this complete permission notice or at a +# minimum a reference to the UPL must be included in all copies or substantial +# portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# name: GraalVM Gate on: @@ -37,19 +77,21 @@ concurrency: env: JAVA_HOME: ${{ github.workspace }}/jdk - JDT: builtin LANG: en_US.UTF-8 MX_GIT_CACHE: refcache MX_PATH: ${{ github.workspace }}/mx MX_PYTHON: python3.8 + # Enforce experimental option checking in CI (GR-47922) + NATIVE_IMAGE_EXPERIMENTAL_OPTIONS_ARE_FATAL: "true" permissions: contents: read # to fetch code (actions/checkout) jobs: - build-graalvm: + build-graalvm-linux: name: /${{ matrix.env.PRIMARY }} ${{ matrix.env.GATE_TAGS }} JDK${{ matrix.env.JDK_VERSION }} runs-on: ubuntu-20.04 + timeout-minutes: 60 strategy: fail-fast: false matrix: @@ -60,7 +102,7 @@ jobs: GATE_TAGS: "style,fullbuild,test" PRIMARY: "compiler" - env: - JDK_VERSION: "21" + JDK_VERSION: "latest" GATE_TAGS: "build,bootstraplite" PRIMARY: "compiler" # /espresso @@ -74,16 +116,16 @@ jobs: GATE_TAGS: "style,fullbuild" PRIMARY: "substratevm" - env: - JDK_VERSION: "21" + JDK_VERSION: "latest" GATE_TAGS: "build,helloworld,native_unittests" PRIMARY: "substratevm" PIP_PACKAGES: "jsonschema==4.6.1" - env: - JDK_VERSION: "21" + JDK_VERSION: "latest" GATE_TAGS: "build,debuginfotest" PRIMARY: "substratevm" - env: - JDK_VERSION: "21" + JDK_VERSION: "latest" GATE_TAGS: "hellomodule" PRIMARY: "substratevm" # /sulong @@ -98,7 +140,7 @@ jobs: PRIMARY: "truffle" # /vm - env: - JDK_VERSION: "21" + JDK_VERSION: "latest" GATE_TAGS: "build,sulong" GATE_OPTS: "--no-warning-as-error" PRIMARY: "vm" @@ -107,7 +149,7 @@ jobs: DISABLE_POLYGLOT: true DISABLE_LIBPOLYGLOT: true - env: - JDK_VERSION: "21" + JDK_VERSION: "latest" GATE_TAGS: "build" GATE_OPTS: "--no-warning-as-error" PRIMARY: "vm" @@ -115,29 +157,29 @@ jobs: NATIVE_IMAGES: "lib:jvmcicompiler,native-image,lib:native-image-agent,lib:native-image-diagnostics-agent,polyglot" WITHOUT_VCS: true env: + JDT: builtin # Compile with ECJ (and javac) as part of gate runs tagged with 'fullbuild' MX_RUNS_DEBUG: ${{ contains(matrix.env.GATE_TAGS, 'debug') || matrix.env.GATE_TAGS == '' }} MX_RUNS_STYLE: ${{ contains(matrix.env.GATE_TAGS, 'style') || matrix.env.GATE_TAGS == '' }} steps: - name: Checkout oracle/graal - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ github.ref }} # Lock ref to current branch to avoid fetching others fetch-depth: "${{ env.MX_RUNS_STYLE && '0' || '1' }}" # The style gate needs the full commit history for checking copyright years - name: Determine mx version run: echo "MX_VERSION=$(jq -r '.mx_version' common.json)" >> ${GITHUB_ENV} - name: Checkout graalvm/mx - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: graalvm/mx.git ref: ${{ env.MX_VERSION }} - fetch-depth: 1 path: ${{ env.MX_PATH }} - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.8' - name: Update mx cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.mx key: ${{ runner.os }}-mx-${{ hashFiles('**/suite.py') }} @@ -157,9 +199,7 @@ jobs: if: ${{ env.MX_RUNS_STYLE == 'true' }} run: | sudo apt install python3-pip python-setuptools - sudo pip install ninja_syntax$(jq -r '.pip.ninja_syntax' common.json) - sudo pip install lazy-object-proxy$(jq -r '.pip["lazy-object-proxy"]' common.json) - sudo pip install pylint$(jq -r '.pip.pylint' common.json) + sudo pip install $(jq -r '[.pip | to_entries[] | join("")] | join(" ")' common.json) - name: Install additional pip packages if: ${{ matrix.env.PIP_PACKAGES != '' }} run: ${MX_PYTHON} -m pip install ${{ matrix.env.PIP_PACKAGES }} @@ -183,3 +223,48 @@ jobs: env: ${{ matrix.env }} run: ${MX_PATH}/mx --primary-suite-path ${PRIMARY} --java-home=${JAVA_HOME} gate --strict-mode ${{ matrix.env.GATE_OPTS }} if: ${{ matrix.env.GATE_TAGS == '' }} + build-graalvm-windows: + name: /substratevm on Windows + runs-on: windows-2022 + timeout-minutes: 60 + env: + MX_PYTHON: 'python' + steps: + - name: Checkout oracle/graal + uses: actions/checkout@v4 + with: + ref: ${{ github.ref }} # Lock ref to current branch to avoid fetching others + - name: Determine mx version + shell: bash + run: echo "MX_VERSION=$(jq -r '.mx_version' common.json)" >> ${GITHUB_ENV} + - name: Checkout graalvm/mx + uses: actions/checkout@v4 + with: + repository: graalvm/mx.git + ref: ${{ env.MX_VERSION }} + path: ${{ env.MX_PATH }} + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.8' + - name: Fetch LabsJDK + shell: bash + run: | + mkdir jdk-dl + ${MX_PATH}/mx --java-home= fetch-jdk --jdk-id labsjdk-ce-latest --to jdk-dl --alias ${JAVA_HOME} + - name: Build GraalVM via cmd.exe + shell: cmd + run: | + call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 + call ${{ env.MX_PATH }}\mx.cmd -p substratevm --native-images=native-image --components="Native Image" build + call ${{ env.MX_PATH }}\mx.cmd -p substratevm --native-images=native-image --components="Native Image" graalvm-home > graalvm-home-with-forward-slashes.txt + set /p GRAALVM_HOME=>%GITHUB_PATH% + echo GRAALVM_HOME=%GRAALVM_HOME%>>%GITHUB_ENV% + - name: Test GraalVM + run: | + native-image --version + native-image -m jdk.httpserver + diff --git a/.github/workflows/micronaut.yml b/.github/workflows/micronaut.yml new file mode 100644 index 000000000000..4077f457eb3a --- /dev/null +++ b/.github/workflows/micronaut.yml @@ -0,0 +1,89 @@ +# +# Copyright (c) 2024, 2024, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# The Universal Permissive License (UPL), Version 1.0 +# +# Subject to the condition set forth below, permission is hereby granted to any +# person obtaining a copy of this software, associated documentation and/or +# data (collectively the "Software"), free of charge and under any and all +# copyright rights in the Software, and any and all patent rights owned or +# freely licensable by each licensor hereunder covering either (i) the +# unmodified Software as contributed to or provided by such licensor, or (ii) +# the Larger Works (as defined below), to deal in both +# +# (a) the Software, and +# +# (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if +# one is included with the Software each a "Larger Work" to which the Software +# is contributed by such licensors), +# +# without restriction, including without limitation the rights to copy, create +# derivative works of, display, perform, and distribute the Software and make, +# use, sell, offer for sale, import, export, have made, and have sold the +# Software and the Larger Work(s), and to sublicense the foregoing rights on +# either these or other terms. +# +# This license is subject to the following condition: +# +# The above copyright notice and either this complete permission notice or at a +# minimum a reference to the UPL must be included in all copies or substantial +# portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# +name: Nightly Micronaut Tests + +on: + push: + paths: + - '.github/workflows/micronaut.yml' + pull_request: + paths: + - '.github/workflows/micronaut.yml' + schedule: + - cron: '0 2 * * *' + workflow_dispatch: + +env: + MICRONAUT_CORE_PATH: ${{ github.workspace }}/micronaut-core + MICRONAUT_JAVA_VERSION: 21 + # Enforce experimental option checking in CI (GR-47922) + NATIVE_IMAGE_EXPERIMENTAL_OPTIONS_ARE_FATAL: 'true' + +permissions: + contents: read # to fetch code (actions/checkout) + +jobs: + build-graalvm-and-micronaut: + name: Native Tests + runs-on: ubuntu-20.04 + if: (github.event_name == 'schedule' && github.repository == 'oracle/graal') || (github.event_name != 'schedule') + steps: + - name: Checkout oracle/graal + uses: actions/checkout@v4 + - name: Build GraalVM JDK + uses: ./.github/actions/build-graalvm + with: + java-version: ${{ env.MICRONAUT_JAVA_VERSION }} + - name: Run nativeTest in Micronaut launch project + run: | + curl --fail --silent --location --retry 3 --max-time 10 --output demo.zip --request GET 'https://launch.micronaut.io/create/default/com.example.demo?lang=JAVA&build=GRADLE&test=JUNIT&javaVersion=JDK_${{ env.MICRONAUT_JAVA_VERSION }}' + unzip demo.zip + cd demo + ./gradlew nativeTest + - name: Checkout micronaut-projects/micronaut-core + uses: actions/checkout@v4 + with: + repository: micronaut-projects/micronaut-core + path: ${{ env.MICRONAUT_CORE_PATH }} + - name: Run nativeTest in micronaut-core + run: | + cd ${{ env.MICRONAUT_CORE_PATH }} + ./gradlew nativeTest diff --git a/.github/workflows/quarkus.yml b/.github/workflows/quarkus.yml index 5a92174e957c..289551edb574 100644 --- a/.github/workflows/quarkus.yml +++ b/.github/workflows/quarkus.yml @@ -1,3 +1,43 @@ +# +# Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# The Universal Permissive License (UPL), Version 1.0 +# +# Subject to the condition set forth below, permission is hereby granted to any +# person obtaining a copy of this software, associated documentation and/or +# data (collectively the "Software"), free of charge and under any and all +# copyright rights in the Software, and any and all patent rights owned or +# freely licensable by each licensor hereunder covering either (i) the +# unmodified Software as contributed to or provided by such licensor, or (ii) +# the Larger Works (as defined below), to deal in both +# +# (a) the Software, and +# +# (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if +# one is included with the Software each a "Larger Work" to which the Software +# is contributed by such licensors), +# +# without restriction, including without limitation the rights to copy, create +# derivative works of, display, perform, and distribute the Software and make, +# use, sell, offer for sale, import, export, have made, and have sold the +# Software and the Larger Work(s), and to sublicense the foregoing rights on +# either these or other terms. +# +# This license is subject to the following condition: +# +# The above copyright notice and either this complete permission notice or at a +# minimum a reference to the UPL must be included in all copies or substantial +# portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# name: Nightly Quarkus Tests on: @@ -9,19 +49,15 @@ on: - '.github/workflows/quarkus.yml' schedule: - cron: '0 3 * * *' + workflow_dispatch: env: COMMON_MAVEN_ARGS: "-e -B --settings .github/mvn-settings.xml --fail-at-end" DB_NAME: hibernate_orm_test DB_PASSWORD: hibernate_orm_test DB_USER: hibernate_orm_test - GRAALVM_HOME: ${{ github.workspace }}/graalvm - LABSJDK_HOME: ${{ github.workspace }}/jdk - LANG: en_US.UTF-8 # Workaround testsuite locale issue - MX_GIT_CACHE: refcache - MX_PATH: ${{ github.workspace }}/mx - MX_PYTHON: python3.8 NATIVE_TEST_MAVEN_ARGS: "-Dtest-containers -Dstart-containers -Dquarkus.native.native-image-xmx=5g -Dnative -Dnative.surefire.skip -Dformat.skip -Dno-descriptor-tests install -DskipDocs -Dquarkus.native.container-build=false" + QUARKUS_JAVA_VERSION: 17 # Use Java 17 to build Quarkus as that's the lowest supported JDK version currently QUARKUS_PATH: ${{ github.workspace }}/quarkus permissions: {} @@ -32,24 +68,16 @@ jobs: name: Nightly Quarkus and GraalVM build runs-on: ubuntu-20.04 + if: (github.event_name == 'schedule' && github.repository == 'oracle/graal') || (github.event_name != 'schedule') outputs: matrix: ${{ steps.read.outputs.matrix }} steps: - name: Checkout oracle/graal - uses: actions/checkout@v3 + uses: actions/checkout@v4 + - name: Build GraalVM JDK + uses: ./.github/actions/build-graalvm with: - fetch-depth: 1 - - name: Checkout graalvm/mx - uses: actions/checkout@v3 - with: - repository: graalvm/mx.git - fetch-depth: 1 - ref: master - path: ${{ env.MX_PATH }} - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.8' + java-version: ${{ env.QUARKUS_JAVA_VERSION }} - name: Get latest Quarkus release run: | export QUARKUS_VERSION=main #$(curl https://repo1.maven.org/maven2/io/quarkus/quarkus-bom/maven-metadata.xml | awk -F"[<>]" '/latest/ {print $3}') @@ -57,34 +85,17 @@ jobs: curl --output quarkus.tgz -sL https://api.github.com/repos/quarkusio/quarkus/tarball/$QUARKUS_VERSION mkdir ${QUARKUS_PATH} tar xf quarkus.tgz -C ${QUARKUS_PATH} --strip-components=1 - - uses: actions/cache@v3 + - uses: actions/cache@v4 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} restore-keys: | ${{ runner.os }}-maven- - - uses: actions/cache@v3 - with: - path: ~/.mx - key: ${{ runner.os }}-mx-${{ hashFiles('**/suite.py') }} - restore-keys: | - ${{ runner.os }}-mx- - - name: Fetch LabsJDK - run: | - mkdir jdk-dl - ${MX_PATH}/mx --java-home= fetch-jdk --jdk-id labsjdk-ce-21 --to jdk-dl --alias ${LABSJDK_HOME} - - name: Build graalvm native-image - run: | - export JAVA_HOME=${LABSJDK_HOME} - cd substratevm - ${MX_PATH}/mx --native=native-image,lib:jvmcicompiler --components="Native Image,LibGraal" build - mv $(${MX_PATH}/mx --native=native-image,lib:jvmcicompiler --components="Native Image,LibGraal" graalvm-home) ${GRAALVM_HOME} - ${GRAALVM_HOME}/bin/native-image --version - - name: Tar GraalVM + - name: Tar GraalVM JDK shell: bash - run: tar -czvf graalvm.tgz -C $(dirname ${GRAALVM_HOME}) $(basename ${GRAALVM_HOME}) - - name: Persist GraalVM build - uses: actions/upload-artifact@v1 + run: tar -czvhf graalvm.tgz -C $(dirname ${GRAALVM_HOME}) $(basename ${GRAALVM_HOME}) + - name: Persist GraalVM JDK build + uses: actions/upload-artifact@v4 with: name: graalvm path: graalvm.tgz @@ -102,7 +113,7 @@ jobs: shell: bash run: tar -czvf maven-repo.tgz -C ~ .m2/repository - name: Persist Maven Repo - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v4 with: name: maven-repo path: maven-repo.tgz @@ -111,6 +122,8 @@ jobs: name: Native Tests - ${{matrix.category}} needs: build-quarkus-and-graalvm runs-on: ubuntu-latest + env: + GRAALVM_HOME: ${{ github.workspace }}/graalvm # identical to the one in ./.github/actions/build-graalvm # Ignore the following YAML Schema error timeout-minutes: ${{matrix.timeout}} strategy: @@ -118,13 +131,13 @@ jobs: fail-fast: false matrix: ${{ fromJson(needs.build-quarkus-and-graalvm.outputs.matrix) }} steps: - - name: Download GraalVM build + - name: Download GraalVM JDK build if: startsWith(matrix.os-name, 'ubuntu') - uses: actions/download-artifact@v1 + uses: actions/download-artifact@v4 with: name: graalvm path: . - - name: Extract GraalVM build + - name: Extract GraalVM JDK build if: startsWith(matrix.os-name, 'ubuntu') shell: bash run: tar -xzvf graalvm.tgz -C $(dirname ${GRAALVM_HOME}) @@ -141,7 +154,7 @@ jobs: run: ${QUARKUS_PATH}/.github/ci-prerequisites.sh - name: Download Maven Repo if: startsWith(matrix.os-name, 'ubuntu') - uses: actions/download-artifact@v1 + uses: actions/download-artifact@v4 with: name: maven-repo path: . @@ -149,17 +162,15 @@ jobs: if: startsWith(matrix.os-name, 'ubuntu') shell: bash run: tar -xzf maven-repo.tgz -C ~ - - uses: graalvm/setup-graalvm@v1 + - uses: actions/setup-java@v4 with: - version: 'latest' + distribution: 'oracle' java-version: '17' - github-token: ${{ secrets.GITHUB_TOKEN }} - name: Build with Maven if: startsWith(matrix.os-name, 'ubuntu') env: TEST_MODULES: ${{matrix.test-modules}} run: | - export GRAALVM_HOME=${{ github.workspace }}/graalvm cd ${QUARKUS_PATH} ${GRAALVM_HOME}/bin/native-image --version ./mvnw $COMMON_MAVEN_ARGS -f integration-tests -pl "$TEST_MODULES" $NATIVE_TEST_MAVEN_ARGS @@ -168,7 +179,7 @@ jobs: shell: bash run: find . -type d -name '*-reports' -o -wholename '*/build/reports/tests/functionalTest' | tar -czf test-reports.tgz -T - - name: Upload failure Archive (if maven failed) - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v4 if: failure() with: name: test-reports-native-${{matrix.category}} diff --git a/.github/workflows/reachability-metadata.yml b/.github/workflows/reachability-metadata.yml new file mode 100644 index 000000000000..b19d621f5103 --- /dev/null +++ b/.github/workflows/reachability-metadata.yml @@ -0,0 +1,139 @@ +# +# Copyright (c) 2024, 2024, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# The Universal Permissive License (UPL), Version 1.0 +# +# Subject to the condition set forth below, permission is hereby granted to any +# person obtaining a copy of this software, associated documentation and/or +# data (collectively the "Software"), free of charge and under any and all +# copyright rights in the Software, and any and all patent rights owned or +# freely licensable by each licensor hereunder covering either (i) the +# unmodified Software as contributed to or provided by such licensor, or (ii) +# the Larger Works (as defined below), to deal in both +# +# (a) the Software, and +# +# (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if +# one is included with the Software each a "Larger Work" to which the Software +# is contributed by such licensors), +# +# without restriction, including without limitation the rights to copy, create +# derivative works of, display, perform, and distribute the Software and make, +# use, sell, offer for sale, import, export, have made, and have sold the +# Software and the Larger Work(s), and to sublicense the foregoing rights on +# either these or other terms. +# +# This license is subject to the following condition: +# +# The above copyright notice and either this complete permission notice or at a +# minimum a reference to the UPL must be included in all copies or substantial +# portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# +name: Weekly Reachability Metadata Tests + +on: + push: + paths: + - '.github/workflows/reachability-metadata.yml' + pull_request: + paths: + - '.github/workflows/reachability-metadata.yml' + schedule: + - cron: '0 1 * * 1' + workflow_dispatch: + +env: + REACHABILITY_METADATA_PATH: ${{ github.workspace }}/graalvm-reachability-metadata + MINIMUM_METADATA_JAVA_VERSION: 17 + +permissions: + contents: read # to fetch code (actions/checkout) + +jobs: + build-graalvm-and-populate-matrix: + name: Build GraalVM and populate matrix + runs-on: ubuntu-20.04 + if: (github.event_name == 'schedule' && github.repository == 'oracle/graal') || (github.event_name != 'schedule') + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - name: Checkout oracle/graal + uses: actions/checkout@v4 + - name: Build GraalVM JDK + uses: ./.github/actions/build-graalvm + with: + native-images: 'native-image,native-image-configure,lib:native-image-agent' + components: 'Native Image,Native Image Configure Tool' + java-version: ${{ env.MINIMUM_METADATA_JAVA_VERSION }} + - name: Tar GraalVM JDK + shell: bash + run: tar -czvhf graalvm.tgz -C $(dirname ${GRAALVM_HOME}) $(basename ${GRAALVM_HOME}) + - name: Persist GraalVM JDK build + uses: actions/upload-artifact@v4 + with: + name: graalvm + path: graalvm.tgz + - name: Checkout oracle/graalvm-reachability-metadata + uses: actions/checkout@v4 + with: + repository: oracle/graalvm-reachability-metadata + path: ${{ env.REACHABILITY_METADATA_PATH }} + - name: "Populate matrix" + id: set-matrix + run: | + cd ${{ env.REACHABILITY_METADATA_PATH }} + ./gradlew generateMatrixMatchingCoordinates -Pcoordinates=all + + test-all-metadata: + name: ${{ matrix.coordinates }} + runs-on: ubuntu-latest + env: + GRAALVM_HOME: ${{ github.workspace }}/graalvm # identical to the one in ./.github/actions/build-graalvm + timeout-minutes: 20 + needs: build-graalvm-and-populate-matrix + strategy: + fail-fast: false + matrix: + coordinates: ${{fromJson(needs.build-graalvm-and-populate-matrix.outputs.matrix).coordinates}} + steps: + - name: "Checkout oracle/graalvm-reachability-metadata" + uses: actions/checkout@v4 + with: + repository: oracle/graalvm-reachability-metadata + - name: Download GraalVM JDK build + uses: actions/download-artifact@v4 + with: + name: graalvm + path: . + - name: Extract GraalVM JDK build + run: tar -xzvf graalvm.tgz -C $(dirname ${GRAALVM_HOME}) + - name: "Setup JAVA_HOME" + uses: actions/setup-java@v4 + with: + distribution: 'oracle' + java-version: ${{ env.MINIMUM_METADATA_JAVA_VERSION }} + - name: "Pull allowed docker images" + run: | + ./gradlew pullAllowedDockerImages --coordinates=${{ matrix.coordinates }} + - name: "Disable docker" + run: | + sudo apt-get install openbsd-inetd + sudo bash -c "cat ./.github/workflows/discard-port.conf >> /etc/inetd.conf" + sudo systemctl start inetd + sudo mkdir /etc/systemd/system/docker.service.d + sudo bash -c "cat ./.github/workflows/dockerd.service > /etc/systemd/system/docker.service.d/http-proxy.conf" + sudo systemctl daemon-reload + sudo systemctl restart docker + - name: "Run '${{ matrix.coordinates }}' tests" + run: | + ./gradlew test -Pcoordinates=${{ matrix.coordinates }} + \ No newline at end of file diff --git a/.github/workflows/spring.yml b/.github/workflows/spring.yml new file mode 100644 index 000000000000..3d2c0a6efa58 --- /dev/null +++ b/.github/workflows/spring.yml @@ -0,0 +1,81 @@ +# +# Copyright (c) 2024, 2024, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# The Universal Permissive License (UPL), Version 1.0 +# +# Subject to the condition set forth below, permission is hereby granted to any +# person obtaining a copy of this software, associated documentation and/or +# data (collectively the "Software"), free of charge and under any and all +# copyright rights in the Software, and any and all patent rights owned or +# freely licensable by each licensor hereunder covering either (i) the +# unmodified Software as contributed to or provided by such licensor, or (ii) +# the Larger Works (as defined below), to deal in both +# +# (a) the Software, and +# +# (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if +# one is included with the Software each a "Larger Work" to which the Software +# is contributed by such licensors), +# +# without restriction, including without limitation the rights to copy, create +# derivative works of, display, perform, and distribute the Software and make, +# use, sell, offer for sale, import, export, have made, and have sold the +# Software and the Larger Work(s), and to sublicense the foregoing rights on +# either these or other terms. +# +# This license is subject to the following condition: +# +# The above copyright notice and either this complete permission notice or at a +# minimum a reference to the UPL must be included in all copies or substantial +# portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# +name: Nightly Spring Tests + +on: + push: + paths: + - '.github/workflows/spring.yml' + pull_request: + paths: + - '.github/workflows/spring.yml' + schedule: + - cron: '0 4 * * *' + workflow_dispatch: + +env: + SPRING_PETCLINIC_PATH: ${{ github.workspace }}/spring-petclinic + SPRING_JAVA_VERSION: 21 + +permissions: + contents: read # to fetch code (actions/checkout) + +jobs: + build-graalvm-and-spring: + name: Native Tests + runs-on: ubuntu-20.04 + if: (github.event_name == 'schedule' && github.repository == 'oracle/graal') || (github.event_name != 'schedule') + steps: + - name: Checkout oracle/graal + uses: actions/checkout@v4 + - name: Build GraalVM JDK + uses: ./.github/actions/build-graalvm + with: + java-version: ${{ env.SPRING_JAVA_VERSION }} + - name: Checkout spring-projects/spring-petclinic + uses: actions/checkout@v4 + with: + repository: spring-projects/spring-petclinic + path: ${{ env.SPRING_PETCLINIC_PATH }} + - name: Run nativeTest in spring-petclinic + run: | + cd ${{ env.SPRING_PETCLINIC_PATH }} + ./gradlew nativeTest