diff --git a/.github/actions/build-serverless-adapter/action.yml b/.github/actions/build-serverless-adapter/action.yml new file mode 100644 index 00000000000..c61dad028b9 --- /dev/null +++ b/.github/actions/build-serverless-adapter/action.yml @@ -0,0 +1,62 @@ +# +# Copyright (c) 2024 Alibaba Group Holding Limited. All Rights Reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Alibaba designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# + +name: 'Build serverless-adapter' +description: 'Build it using built JDK' +inputs: + java-home: + required: true + +runs: + using: composite + steps: + - name: 'Checkout serverless-adapter source code' + id: serverless_adapter_checkout + uses: actions/checkout@v3 + with: + repository: dragonwell-project/serverless-adapter-jdk8 + ref: main + path: serverless-adapter + + - name: 'Install dependencies' + id: install_dep + run: | + mkdir -p maven + wget https://dlcdn.apache.org/maven/maven-3/3.8.8/binaries/apache-maven-3.8.8-bin.tar.gz + tar -xvf apache-maven-3.8.8-bin.tar.gz -C maven --strip-components=1 + echo "maven_home=${GITHUB_WORKSPACE}/maven/bin" >> $GITHUB_OUTPUT + shell: bash + + - name: 'Build serverless-adapter' + id: serverless_adapter_build + run: | + export JAVA_HOME=${{ inputs.java-home }} + export PATH=${{ inputs.java-home }}/bin:${{ steps.install_dep.outputs.maven_home }}:$PATH + mvn package + shell: bash + working-directory: serverless-adapter + + - name: 'Copy serverless-adapter into boot jdk' + run: | + mkdir -p ${{ inputs.java-home }}/jre/lib/serverless + cp -f serverless-adapter/target/serverless-adapter-0.1.jar ${{ inputs.java-home }}/jre/lib/serverless/serverless-adapter.jar + cp -f serverless-adapter/output/libloadclassagent.so ${{ inputs.java-home }}/jre/lib/serverless/libloadclassagent.so + shell: bash diff --git a/.github/actions/get-bootjdk/action.yml b/.github/actions/get-bootjdk/action.yml new file mode 100644 index 00000000000..6f6704acc94 --- /dev/null +++ b/.github/actions/get-bootjdk/action.yml @@ -0,0 +1,54 @@ +# +# Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +inputs: + platform: + description: 'Platform name' + required: true +outputs: + boot_jdk: + value: ${{ steps.get_jdk.outputs.boot_jdk }} + +runs: + using: composite + steps: + - name: 'Determine jdk url' + id: get_jdk_url + run: | + if [ "${{ inputs.platform }}" = "x86_64" ] ; then + echo "jdk_url= https://dragonwell.oss-cn-shanghai.aliyuncs.com/8.15.16/Alibaba_Dragonwell_Extended_8.15.16_x64_linux.tar.gz" >> $GITHUB_OUTPUT + elif [ "${{ inputs.platform }}" = "aarch64" ] ; then + echo "jdk_url= https://dragonwell.oss-cn-shanghai.aliyuncs.com/8.15.16/Alibaba_Dragonwell_Extended_8.15.16_aarch64_linux.tar.gz" >> $GITHUB_OUTPUT + fi + shell: bash + + - name: 'Get jdk' + id: get_jdk + run: | + wget ${{ steps.get_jdk_url.outputs.jdk_url }} -O jdk.tar.gz + mkdir -p bootJdk + tar zxvf jdk.tar.gz -C bootJdk --strip-components=1 + echo "boot_jdk=${PWD}/bootJdk" >> $GITHUB_OUTPUT + shell: bash diff --git a/.github/actions/get-bundles/action.yml b/.github/actions/get-bundles/action.yml new file mode 100644 index 00000000000..b3c6310ede5 --- /dev/null +++ b/.github/actions/get-bundles/action.yml @@ -0,0 +1,111 @@ +# +# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +name: 'Get bundles' +description: 'Download resulting JDK bundles' +inputs: + platform: + description: 'Platform name' + required: true + debug-suffix: + description: 'File name suffix denoting debug level, possibly empty' + required: false + bundle_id: + required: true +outputs: + jdk-path: + description: 'Path to the installed JDK bundle' + value: ${{ steps.path-name.outputs.jdk }} + symbols-path: + description: 'Path to the installed symbols bundle' + value: ${{ steps.path-name.outputs.symbols }} + tests-path: + description: 'Path to the installed tests bundle' + value: ${{ steps.path-name.outputs.tests }} + +runs: + using: composite + steps: + - name: 'Download bundles artifact' + id: download-bundles + uses: actions/download-artifact@v3 + with: + name: ${{ inputs.platform }}-${{ matrix.debug-suffix }}-image-${{ inputs.bundle_id }} + path: bundles + continue-on-error: true + + - name: 'Download bundles artifact (retry)' + uses: actions/download-artifact@v3 + with: + name: bundles-${{ inputs.platform }}${{ inputs.debug-suffix }} + path: bundles + if: steps.download-bundles.outcome == 'failure' + + - name: 'Unpack bundles' + run: | + if [[ -e bundles/jdk-${{ inputs.platform }}${{ inputs.debug-suffix }}.zip ]]; then + echo 'Unpacking jdk bundle...' + mkdir -p bundles/jdk + unzip -q bundles/jdk-${{ inputs.platform }}${{ inputs.debug-suffix }}.zip -d bundles/jdk + fi + + if [[ -e bundles/jdk-${{ inputs.platform }}${{ inputs.debug-suffix }}.tar.gz ]]; then + echo 'Unpacking jdk bundle...' + mkdir -p bundles/jdk + tar -xf bundles/jdk-${{ inputs.platform }}${{ inputs.debug-suffix }}.tar.gz -C bundles/jdk --strip-components=1 + fi + + if [[ -e bundles/symbols-${{ inputs.platform }}${{ inputs.debug-suffix }}.tar.gz ]]; then + echo 'Unpacking symbols bundle...' + mkdir -p bundles/symbols + tar -xf bundles/symbols-${{ inputs.platform }}${{ inputs.debug-suffix }}.tar.gz -C bundles/symbols --strip-components=1 + fi + + if [[ -e bundles/tests-${{ inputs.platform }}${{ inputs.debug-suffix }}.tar.gz ]]; then + echo 'Unpacking tests bundle...' + mkdir -p bundles/tests + tar -xf bundles/tests-${{ inputs.platform }}${{ inputs.debug-suffix }}.tar.gz -C bundles/tests --strip-components=1 + fi + shell: bash + + - name: 'Export paths to where bundles are installed' + id: path-name + run: | + # Export the paths + + jdk_dir="$GITHUB_WORKSPACE/$(dirname $(find bundles/jdk -name bin -type d))" + symbols_dir="$GITHUB_WORKSPACE/$(dirname $(find bundles/symbols -name bin -type d))" + tests_dir="$GITHUB_WORKSPACE/bundles/tests" + + if [[ '${{ runner.os }}' == 'Windows' ]]; then + jdk_dir="$(cygpath $jdk_dir)" + symbols_dir="$(cygpath $symbols_dir)" + tests_dir="$(cygpath $tests_dir)" + fi + + echo "jdk=$jdk_dir" >> $GITHUB_OUTPUT + echo "symbols=$symbols_dir" >> $GITHUB_OUTPUT + echo "tests=$tests_dir" >> $GITHUB_OUTPUT + shell: bash diff --git a/.github/actions/get-jtreg/action.yml b/.github/actions/get-jtreg/action.yml new file mode 100644 index 00000000000..405fff5e2da --- /dev/null +++ b/.github/actions/get-jtreg/action.yml @@ -0,0 +1,68 @@ +# +# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +name: 'Get JTReg' +description: 'Download JTReg from cache or source location' +outputs: + path: + description: 'Path to the installed JTReg' + value: ${{ steps.path-name.outputs.path }} + +runs: + using: composite + steps: + - name: 'Get JTReg version configuration' + id: version + run: | + jtreg_version=`grep -h 'JTREG_VERSION' make/conf/test-dependencies | cut -d '=' -f 2` + echo "value=${jtreg_version}" >> $GITHUB_OUTPUT + shell: bash + + - name: 'Checkout the JTReg source' + uses: actions/checkout@v4 + with: + repository: openjdk/jtreg + ref: jtreg-${{ steps.version.outputs.value }} + path: jtreg/src + if: steps.get-cached-jtreg.outputs.cache-hit != 'true' + + - name: 'Build JTReg' + run: | + # Build JTReg and move files to the proper locations + jdkPath="$(which java)" + javaHome=${jdkPath%%'/bin'*} + bash make/build.sh --jdk "$javaHome" + mkdir ../installed + mv build/images/jtreg/* ../installed + working-directory: jtreg/src + shell: bash + if: steps.get-cached-jtreg.outputs.cache-hit != 'true' + + - name: 'Export path to where JTReg is installed' + id: path-name + run: | + # Export the path + echo 'path=jtreg/installed' >> $GITHUB_OUTPUT + shell: bash diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml new file mode 100644 index 00000000000..ba4fb83e520 --- /dev/null +++ b/.github/workflows/build-linux.yml @@ -0,0 +1,131 @@ +# +# Copyright (c) 2024 Alibaba Group Holding Limited. All Rights Reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Alibaba designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# + +name: 'Build (linux)' + +on: + workflow_call: + inputs: + platform: + required: true + type: string + make-target: + required: false + type: string + default: '"images"' + make-conf: + required: false + type: string + debug-levels: + required: false + type: string + default: '[ "debug", "release" ]' + apt-extra-packages: + required: false + type: string + configure-arguments: + required: false + type: string + runs-on: + required: true + type: string + #docker-image: + # required: true + # type: string + bundle_id: + required: true + type: string + +jobs: + build-linux: + name: build + runs-on: ${{ fromJSON(inputs.runs-on) }} + #container: + # image: ${{ inputs.docker-image }} + + strategy: + fail-fast: false + matrix: + debug-level: ${{ fromJSON(inputs.debug-levels) }} + include: + - debug-level: release + flags: --with-debug-level=release + conf-suffix: release + - debug-level: debug + flags: --with-debug-level=fastdebug + suffix: -debug + conf-suffix: fastdebug + + steps: + - name: 'Install dependencies' + run: | + sudo apt update -y + sudo apt install -y ${{ inputs.apt-extra-packages }} + if: ${{ inputs.apt-extra-packages }} != '' + + - name: 'Checkout the JDK source' + uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.sha }} + + - name: 'Get boot jdk' + id: get_boot_jdk + uses: ./.github/actions/get-bootjdk + with: + platform: ${{ inputs.platform }} + + - name: 'Configure' + run: > + bash configure + --with-boot-jdk=${{ steps.get_boot_jdk.outputs.boot_jdk }} + ${{ matrix.flags }} + ${{ inputs.configure-arguments }} || ( + echo "Dumping config.log:" && + cat config.log && + exit 1) + + - name: 'Build' + id: build + run: | + make clean + make ${{ inputs.make-target }} CONF=${{ inputs.make-conf }}-${{ matrix.conf-suffix }} + + - name: 'Build serverless-adapter' + id: build-serverless-adapter + uses: ./.github/actions/build-serverless-adapter + with: + java-home: ${GITHUB_WORKSPACE}/build/${{ inputs.make-conf }}-${{matrix.conf-suffix}}/images/j2sdk-image + if: ${{ matrix.debug-level }} == 'release' + + - name: 'Create bundle file' + id: get_bundle_file + run: | + filename=linux-${{ inputs.platform }}-${{ matrix.debug-level }}-image-${{ inputs.bundle_id }}.tar.gz + tar zcvf ${filename} -C ${GITHUB_WORKSPACE}/build/${{ inputs.make-conf }}-${{ matrix.conf-suffix }}/images/ j2sdk-image + echo "bundle_file=${filename}" >> $GITHUB_OUTPUT + echo "bundle_path=${GITHUB_WORKSPACE}/${filename}" >> $GITHUB_OUTPUT + shell: bash + + - name: 'Upload jdk image' + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.get_bundle_file.outputs.bundle_file }} + path: ${{ steps.get_bundle_file.outputs.bundle_path }} diff --git a/.github/workflows/check_pr.yml b/.github/workflows/check_pr.yml index 93ee21bb03e..0212eb4d4fc 100644 --- a/.github/workflows/check_pr.yml +++ b/.github/workflows/check_pr.yml @@ -1,5 +1,5 @@ # -# Copyright (c) 2019 Alibaba Group Holding Limited. All Rights Reserved. +# Copyright (c) 2024 Alibaba Group Holding Limited. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -19,13 +19,59 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. # -name: Dragonwell_8_commit_style_check +name: Prerequisites -on: [pull_request] +on: + workflow_call: + inputs: + platforms: + required: true + type: string + outputs: + should_run: + value: ${{ jobs.prerequisites.outputs.should_run }} + bundle_id: + value: ${{ jobs.prerequisites.outputs.bundle_id }} + platform_linux_x64: + value: ${{ jobs.prerequisites.outputs.platform_linux_x64 }} + platform_linux_aarch64: + value: ${{ jobs.prerequisites.outputs.platform_linux_aarch64 }} + platform_windows_x64: + value: ${{ jobs.prerequisites.outputs.platform_windows_x64 }} jobs: - check_commit: + #check_commit: + # name: Check Commit Message + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v2 + # - uses: dragonwell-releng/check_commit_action@master + # if: github.event_name == 'pull_request' + + prerequisites: + name: 'Prerequisites' runs-on: ubuntu-latest + outputs: + should_run: ${{ steps.check_submit.outputs.should_run }} + bundle_id: ${{ steps.check_bundle_id.outputs.bundle_id }} + platform_linux_x64: ${{ steps.check_platforms.outputs.platform_linux_x64 }} + platform_linux_aarch64: ${{ steps.check_platforms.outputs.platform_linux_aarch64 }} + platform_windows_x64: ${{ steps.check_platforms.outputs.platform_windows_x64 }} + steps: - - uses: actions/checkout@v2 - - uses: dragonwell-releng/check_commit_action@master \ No newline at end of file + - name: 'Check if submit tests should actually run depending on secrets and manual triggering' + id: check_submit + run: echo "::set-output name=should_run::${{ inputs.platforms != '' || (!secrets.JDK_SUBMIT_FILTER || startsWith(github.ref, 'refs/heads/submit/')) }}" + + - name: 'Check which platforms should be included' + id: check_platforms + run: | + echo "::set-output name=platform_linux_x64::${{ contains(inputs.platforms, 'linux x64') || (inputs.platforms == '') }}" + echo "::set-output name=platform_linux_aarch64::${{ contains(inputs.platforms, 'linux aarch64') || (inputs.platforms == '') }}" + echo "::set-output name=platform_windows_x64::${{ contains(inputs.platforms, 'windows x64') || (inputs.platforms == '') }}" + if: steps.check_submit.outputs.should_run != false + + - name: 'Determine unique bundle identifier' + id: check_bundle_id + run: echo "::set-output name=bundle_id::${GITHUB_ACTOR}_${GITHUB_SHA:0:8}" + if: steps.check_submit.outputs.should_run != 'false' diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000000..31b593363bd --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,310 @@ +# +# Copyright (c) 2024 Alibaba Group Holding Limited. All Rights Reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Alibaba designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# + +name: 'Dragonwell GHA Sanity Checks' + +on: + pull_request: + branches: + - master + workflow_dispatch: + inputs: + platforms: + description: 'Platform(s) to execute on (comma separated, e.g. "linux-x64, macos, aarch64")' + required: true + default: 'linux x64, linux aarch64, windows x64' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + prerequisites: + name: Prerequisites + uses: ./.github/workflows/check_pr.yml + with: + platforms: 'linux x64, linux aarch64, windows x64' + + build-linux-x64: + needs: prerequisites + name: linux-x64 + uses: ./.github/workflows/build-linux.yml + with: + platform: x86_64 + configure-arguments: --with-cacerts-file=${GITHUB_WORKSPACE}/common/security/cacerts --with-milestone=fcs --enable-unlimited-crypto + make-target: images + make-conf: linux-x86_64-normal-server + runs-on: '"ubuntu-20.04"' + apt-extra-packages: libxtst-dev libxt-dev libxrender-dev libxrandr-dev libxi-dev libcups2-dev libfontconfig1-dev libasound2-dev unzip zip openjdk-8-jdk + bundle_id: ${{ needs.prerequisites.outputs.bundle_id }} + if: needs.prerequisites.outputs.should_run != 'false' && needs.prerequisites.outputs.platform_linux_x64 != 'false' + + #build-linux-aarch64: + # needs: prerequisites + # name: linux-aarch64 + # uses: ./.github/workflows/build-linux.yml + # with: + # platform: aarch64 + # configure-arguments: --with-cacerts-file=${GITHUB_WORKSPACE}/common/security/cacerts --with-milestone=fcs --enable-unlimited-crypto + # make-target: images + # make-conf: linux-aarch64-normal-server + # runs-on: '["self-hosted", "ARM64"]' + # apt-extra-packages: libxtst-dev libxt-dev libxrender-dev libxrandr-dev libxi-dev libcups2-dev libfontconfig1-dev libasound2-dev unzip zip openjdk-8-jdk + # bundle_id: ${{ needs.prerequisites.outputs.bundle_id }} + # if: needs.prerequisites.outputs.should_run != 'false' && needs.prerequisites.outputs.platform_linux_aarch64 != 'false' + + test-linux-x64: + name: linux-x64 + needs: + - prerequisites + - build-linux-x64 + uses: ./.github/workflows/test.yml + with: + platform: linux-x86_64 + runs-on: '"ubuntu-20.04"' + bundle_id: ${{ needs.prerequisites.outputs.bundle_id }} + + #linux_x64_build: + # needs: prerequisites + # name: Linux x64 + # runs-on: "ubuntu-20.04" + # container: + # image: docker.io/dragonwelljdk/build_jdk:8u + # steps: + # - name: Checkout target source + # uses: actions/checkout@v3 + # with: + # ref: ${{ github.event.pull_request.head.sha }} + # - name: Compile debug + # run: | + # sh configure --with-debug-level=fastdebug --with-cacerts-file=${PWD}/common/security/cacerts --with-milestone=fcs --enable-unlimited-crypto + # make images CONF=linux-x86_64-normal-server-fastdebug + # - name: Compile release + # run: | + # make clean || true + # [ -d build ] && rm -rf build + # sh configure --with-debug-level=release --with-cacerts-file=${PWD}/common/security/cacerts --with-milestone=fcs --enable-unlimited-crypto + # make images CONF=linux-x86_64-normal-server-release + # - name: Install dependencies + # run: | + # wget https://dlcdn.apache.org/maven/maven-3/3.8.8/binaries/apache-maven-3.8.8-bin.tar.gz + # tar -xvf apache-maven-3.8.8-bin.tar.gz + # - name: Download serverless-adapter-jdk8 source code + # uses: actions/checkout@v3 + # with: + # repository: dragonwell-project/serverless-adapter-jdk8 + # ref: main + # path: serverless-adapter-jdk8 + # - name: Build serverless-adapter-jdk8 + # run: | + # export JAVA_HOME=../build/linux-x86_64-normal-server-release/images/j2sdk-image + # ../apache-maven-3.8.8/bin/mvn package + # mkdir -p ../build/linux-x86_64-normal-server-release/images/j2sdk-image/jre/lib/amd64/serverless + # cp -f target/serverless-adapter-0.1.jar ../build/linux-x86_64-normal-server-release/images/j2sdk-image/jre/lib/amd64/serverless/serverless-adapter.jar + # cp -f output/libloadclassagent.so ../build/linux-x86_64-normal-server-release/images/j2sdk-image/jre/lib/amd64/serverless/ + # working-directory: serverless-adapter-jdk8 + # - name: Upload Test image + # uses: actions/upload-artifact@v2 + # with: + # name: dragonwell8_x86_release_image_${{ needs.prerequisites.outputs.bundle_id }} + # path: | + # build/linux-x86_64-normal-server-release/images/j2sdk-image + + #linux_x64_test: + # name: Linux x64 Test + # needs: + # - prerequisites + # - linux_x64_build + + # runs-on: "ubuntu-20.04" + # container: + # image: docker.io/dragonwelljdk/build_jdk:8u + # strategy: + # fail-fast: false + # matrix: + # test: + # - jdk/test/:jdk_tier1 + # - jdk/test/:dragonwell_jdk_features + # - hotspot/test/:hotspot_tier1 + # - hotspot/test/:hotspot_jwarmup + # - hotspot/test/:hotspot_elastic_heap + # - hotspot/test/:hotspot_multi_tenant + # steps: + # - name: Checkout target source + # uses: actions/checkout@v3 + # with: + # ref: ${{ github.event.pull_request.head.sha }} + # - name: Clear Dragonwell8 Dir + # run: | + # rm -rf /opt/dragonwell8 + # - name: Download image + # id: jtreg_restore + # uses: actions/download-artifact@v2 + # with: + # name: dragonwell8_x86_release_image_${{ needs.prerequisites.outputs.bundle_id }} + # path: /opt/dragonwell8 + # continue-on-error: false + # - name: Test image version + # run: | + # ls /opt/dragonwell8 + # chmod -R 777 /opt/dragonwell8 + # /opt/dragonwell8/bin/java -version + # - name: Test + # run: | + # jtreg -agentvm -a -ea -esa -v:fail,error,time,nopass -jdk:/opt/dragonwell8 -exclude:"/__w/dragonwell8/dragonwell8/hotspot/test/ProblemList.txt" -exclude:"/__w/dragonwell8/dragonwell8/jdk/test/ProblemList.txt" "${{ matrix.test }}" + # - name: Check that all tests executed successfully + # run: > + # if [[ egrep -q "(failed|error)" /__w/dragonwell8/dragonwell8/JTreport/text/stats.txt ]]; then + # cat /__w/dragonwell8/dragonwell8/JTreport/newfailures.txt /__w/dragonwell8/dragonwell8/JTreport/other_errors.txt; + # exit 1 ; + # fi + + #linux_aarch64_release_build: + # needs: prerequisites + # name: Linux aarch64(release) + # runs-on: ["ubuntu", "ARM64"] + # steps: + # - name: Update apt and download dependency + # run: | + # sudo apt update -y + # sudo apt install -y libxtst-dev libxt-dev libxrender-dev libxrandr-dev libxi-dev libcups2-dev libfontconfig1-dev libasound2-dev unzip zip openjdk-8-jdk + # - name: Get boot jdk + # run: | + # if [ ! -f /home/${USER}/dragonwell8/dragonwell-8.15.16/bin/java ];then + # mkdir -p /home/${USER}/dragonwell8 + # rm -rf /home/${USER}/dragonwell8/* /home/${USER}/dragonwell8.tar.gz + # wget https://dragonwell.oss-cn-shanghai.aliyuncs.com/8.15.16/Alibaba_Dragonwell_Extended_8.15.16_aarch64_linux.tar.gz -O /home/${USER}/dragonwell8.tar.gz + # tar zxf /home/${USER}/dragonwell8.tar.gz -C /home/${USER}/dragonwell8 + # fi + # - name: Checkout target source + # uses: actions/checkout@v3 + # with: + # ref: ${{ github.event.pull_request.head.sha }} + # - name: Compile release + # run: | + # sh configure --with-debug-level=release --with-cacerts-file=${PWD}/common/security/cacerts --with-milestone=fcs --enable-unlimited-crypto --with-boot-jdk=/home/${USER}/dragonwell8/dragonwell-8.15.16 + # make images CONF=linux-aarch64-normal-server-release + # - name: Install dependencies + # run: | + # wget https://dlcdn.apache.org/maven/maven-3/3.8.8/binaries/apache-maven-3.8.8-bin.tar.gz + # tar -xvf apache-maven-3.8.8-bin.tar.gz + # - name: Download serverless-adapter-jdk8 source code + # uses: actions/checkout@v3 + # with: + # repository: dragonwell-project/serverless-adapter-jdk8 + # ref: main + # path: serverless-adapter-jdk8 + # - name: Build serverless-adapter-jdk8 + # run: | + # export JAVA_HOME=../build/linux-aarch64-normal-server-release/images/j2sdk-image + # ../apache-maven-3.8.8/bin/mvn package + # mkdir -p ../build/linux-aarch64-normal-server-release/images/j2sdk-image/jre/lib/aarch64/serverless + # cp -f target/serverless-adapter-0.1.jar ../build/linux-aarch64-normal-server-release/images/j2sdk-image/jre/lib/aarch64/serverless/serverless-adapter.jar + # cp -f output/libloadclassagent.so ../build/linux-aarch64-normal-server-release/images/j2sdk-image/jre/lib/aarch64/serverless/ + # ../build/linux-aarch64-normal-server-release/images/j2sdk-image/bin/java -version + # working-directory: serverless-adapter-jdk8 + # - name: Upload Test image + # uses: actions/upload-artifact@v2 + # with: + # name: dragonwell8_aarch64_release_image_${{ needs.prerequisites.outputs.bundle_id }} + # path: | + # build/linux-aarch64-normal-server-release/images/j2sdk-image + + #linux_aarch64_debug_build: + # needs: prerequisites + # name: Linux aarch64(fastdebug) + # runs-on: ["ubuntu", "ARM64"] + # steps: + # - name: Update apt and download dependency + # run: | + # sudo apt update -y + # sudo apt install -y libxtst-dev libxt-dev libxrender-dev libxrandr-dev libxi-dev libcups2-dev libfontconfig1-dev libasound2-dev unzip zip openjdk-8-jdk + # - name: Get boot jdk + # run: | + # if [ ! -f /home/${USER}/dragonwell8/dragonwell-8.15.16/bin/java ];then + # mkdir -p /home/${USER}/dragonwell8 + # rm -rf /home/${USER}/dragonwell8/* /home/${USER}/dragonwell8.tar.gz + # wget https://dragonwell.oss-cn-shanghai.aliyuncs.com/8.15.16/Alibaba_Dragonwell_Extended_8.15.16_aarch64_linux.tar.gz -O /home/${USER}/dragonwell8.tar.gz + # tar zxf /home/${USER}/dragonwell8.tar.gz -C /home/${USER}/dragonwell8 + # fi + # - name: Checkout target source + # uses: actions/checkout@v3 + # with: + # ref: ${{ github.event.pull_request.head.sha }} + # - name: Compile debug + # run: | + # sh configure --with-debug-level=fastdebug --with-cacerts-file=${PWD}/common/security/cacerts --with-milestone=fcs --enable-unlimited-crypto --with-boot-jdk=/home/${USER}/dragonwell8/dragonwell-8.15.16 + # make images CONF=linux-aarch64-normal-server-fastdebug + + #linux_aarch64_test: + # name: Linux aarch64 Test + # needs: + # - prerequisites + # - linux_aarch64_release_build + + # runs-on: ["ubuntu", "ARM64"] + # strategy: + # fail-fast: false + # matrix: + # test: + # - jdk/test/:jdk_tier1 + # - jdk/test/:dragonwell_jdk_features + # - hotspot/test/:hotspot_tier1 + # - hotspot/test/:hotspot_jwarmup + # - hotspot/test/:hotspot_elastic_heap + # steps: + # - name: Checkout target source + # uses: actions/checkout@v3 + # with: + # ref: ${{ github.event.pull_request.head.sha }} + # - name: Clear Dragonwell8 Dir + # run: | + # rm -rf /opt/dragonwell8 + # - name: Download image + # id: jtreg_restore + # uses: actions/download-artifact@v2 + # with: + # name: dragonwell8_aarch64_release_image_${{ needs.prerequisites.outputs.bundle_id }} + # path: /opt/dragonwell8 + # continue-on-error: false + # - name: Test image version + # run: | + # ls /opt/dragonwell8 + # chmod -R 777 /opt/dragonwell8 + # /opt/dragonwell8/bin/java -version + # - name: Get jtreg image + # run: | + # if [ ! -f /home/${USER}/jtreg/bin/jtreg ];then + # wget https://compiler-ci-bucket.oss-cn-hangzhou.aliyuncs.com/tools/jtreg_5_1_b01.zip -O /home/${USER}/jtreg_5_1_b01.zip + # cd /home/${USER} + # sudo apt update -y + # sudo apt install -y unzip + # unzip jtreg_5_1_b01.zip + # fi + # - name: Test + # run: | + # /home/${USER}/jtreg/bin/jtreg -agentvm -a -ea -esa -v:fail,error,time,nopass -jdk:/opt/dragonwell8 -exclude:"/home/${USER}/actions-runner/_work/dragonwell8/dragonwell8/hotspot/test/ProblemList.txt" -exclude:"/home/${USER}/actions-runner/_work/dragonwell8/dragonwell8/jdk/test/ProblemList.txt" "${{ matrix.test }}" + # - name: Check that all tests executed successfully + # run: > + # if [ -n "$(cat /home/${USER}/actions-runner/_work/dragonwell8/dragonwell8/JTreport/text/stats.txt | grep -E 'failed|error')" ]; then + # cat /home/${USER}/actions-runner/_work/dragonwell8/dragonwell8/JTreport/newfailures.txt /home/${USER}/actions-runner/_work/dragonwell8/dragonwell8/JTreport/other_errors.txt; + # exit 1 ; + # fi diff --git a/.github/workflows/submit.yml b/.github/workflows/submit.yml deleted file mode 100644 index f2acbafc27d..00000000000 --- a/.github/workflows/submit.yml +++ /dev/null @@ -1,264 +0,0 @@ -# -# Copyright (c) 2022 Alibaba Group Holding Limited. All Rights Reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Alibaba designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# - -name: Dragonwell_8_build_test - -on: - pull_request: - types: [opened, synchronize, reopened] - -jobs: - prerequisites: - name: Prerequisites - runs-on: "ubuntu-20.04" - outputs: - bundle_id: ${{ steps.check_bundle_id.outputs.bundle_id }} - steps: - - name: Determine unique bundle identifier - id: check_bundle_id - run: echo "::set-output name=bundle_id::${GITHUB_ACTOR}_${GITHUB_SHA:0:8}" - - linux_x64_build: - needs: prerequisites - name: Linux x64 - runs-on: "ubuntu-20.04" - container: - image: docker.io/dragonwelljdk/build_jdk:8u - steps: - - name: Checkout target source - uses: actions/checkout@v3 - with: - ref: ${{ github.event.pull_request.head.sha }} - - name: Compile debug - run: | - sh configure --with-debug-level=fastdebug --with-cacerts-file=${PWD}/common/security/cacerts --with-milestone=fcs --enable-unlimited-crypto - make images CONF=linux-x86_64-normal-server-fastdebug - - name: Compile release - run: | - make clean || true - [ -d build ] && rm -rf build - sh configure --with-debug-level=release --with-cacerts-file=${PWD}/common/security/cacerts --with-milestone=fcs --enable-unlimited-crypto - make images CONF=linux-x86_64-normal-server-release - - name: Install dependencies - run: | - wget https://dlcdn.apache.org/maven/maven-3/3.8.8/binaries/apache-maven-3.8.8-bin.tar.gz - tar -xvf apache-maven-3.8.8-bin.tar.gz - - name: Download serverless-adapter-jdk8 source code - uses: actions/checkout@v3 - with: - repository: dragonwell-project/serverless-adapter-jdk8 - ref: main - path: serverless-adapter-jdk8 - - name: Build serverless-adapter-jdk8 - run: | - export JAVA_HOME=../build/linux-x86_64-normal-server-release/images/j2sdk-image - ../apache-maven-3.8.8/bin/mvn package - mkdir -p ../build/linux-x86_64-normal-server-release/images/j2sdk-image/jre/lib/amd64/serverless - cp -f target/serverless-adapter-0.1.jar ../build/linux-x86_64-normal-server-release/images/j2sdk-image/jre/lib/amd64/serverless/serverless-adapter.jar - cp -f output/libloadclassagent.so ../build/linux-x86_64-normal-server-release/images/j2sdk-image/jre/lib/amd64/serverless/ - working-directory: serverless-adapter-jdk8 - - name: Upload Test image - uses: actions/upload-artifact@v2 - with: - name: dragonwell8_x86_release_image_${{ needs.prerequisites.outputs.bundle_id }} - path: | - build/linux-x86_64-normal-server-release/images/j2sdk-image - - linux_x64_test: - name: Linux x64 Test - needs: - - prerequisites - - linux_x64_build - - runs-on: "ubuntu-20.04" - container: - image: docker.io/dragonwelljdk/build_jdk:8u - strategy: - fail-fast: false - matrix: - test: - - jdk/test/:jdk_tier1 - - jdk/test/:dragonwell_jdk_features - - hotspot/test/:hotspot_tier1 - - hotspot/test/:hotspot_jwarmup - - hotspot/test/:hotspot_elastic_heap - - hotspot/test/:hotspot_multi_tenant - steps: - - name: Checkout target source - uses: actions/checkout@v3 - with: - ref: ${{ github.event.pull_request.head.sha }} - - name: Clear Dragonwell8 Dir - run: | - rm -rf /opt/dragonwell8 - - name: Download image - id: jtreg_restore - uses: actions/download-artifact@v2 - with: - name: dragonwell8_x86_release_image_${{ needs.prerequisites.outputs.bundle_id }} - path: /opt/dragonwell8 - continue-on-error: false - - name: Test image version - run: | - ls /opt/dragonwell8 - chmod -R 777 /opt/dragonwell8 - /opt/dragonwell8/bin/java -version - - name: Test - run: | - jtreg -agentvm -a -ea -esa -v:fail,error,time,nopass -jdk:/opt/dragonwell8 -exclude:"/__w/dragonwell8/dragonwell8/hotspot/test/ProblemList.txt" -exclude:"/__w/dragonwell8/dragonwell8/jdk/test/ProblemList.txt" "${{ matrix.test }}" - - name: Check that all tests executed successfully - run: > - if [[ egrep -q "(failed|error)" /__w/dragonwell8/dragonwell8/JTreport/text/stats.txt ]]; then - cat /__w/dragonwell8/dragonwell8/JTreport/newfailures.txt /__w/dragonwell8/dragonwell8/JTreport/other_errors.txt; - exit 1 ; - fi - - linux_aarch64_release_build: - needs: prerequisites - name: Linux aarch64(release) - runs-on: ["ubuntu", "ARM64"] - steps: - - name: Update apt and download dependency - run: | - sudo apt update -y - sudo apt install -y libxtst-dev libxt-dev libxrender-dev libxrandr-dev libxi-dev libcups2-dev libfontconfig1-dev libasound2-dev unzip zip openjdk-8-jdk - - name: Get boot jdk - run: | - if [ ! -f /home/${USER}/dragonwell8/dragonwell-8.15.16/bin/java ];then - mkdir -p /home/${USER}/dragonwell8 - rm -rf /home/${USER}/dragonwell8/* /home/${USER}/dragonwell8.tar.gz - wget https://dragonwell.oss-cn-shanghai.aliyuncs.com/8.15.16/Alibaba_Dragonwell_Extended_8.15.16_aarch64_linux.tar.gz -O /home/${USER}/dragonwell8.tar.gz - tar zxf /home/${USER}/dragonwell8.tar.gz -C /home/${USER}/dragonwell8 - fi - - name: Checkout target source - uses: actions/checkout@v3 - with: - ref: ${{ github.event.pull_request.head.sha }} - - name: Compile release - run: | - sh configure --with-debug-level=release --with-cacerts-file=${PWD}/common/security/cacerts --with-milestone=fcs --enable-unlimited-crypto --with-boot-jdk=/home/${USER}/dragonwell8/dragonwell-8.15.16 - make images CONF=linux-aarch64-normal-server-release - - name: Install dependencies - run: | - wget https://dlcdn.apache.org/maven/maven-3/3.8.8/binaries/apache-maven-3.8.8-bin.tar.gz - tar -xvf apache-maven-3.8.8-bin.tar.gz - - name: Download serverless-adapter-jdk8 source code - uses: actions/checkout@v3 - with: - repository: dragonwell-project/serverless-adapter-jdk8 - ref: main - path: serverless-adapter-jdk8 - - name: Build serverless-adapter-jdk8 - run: | - export JAVA_HOME=../build/linux-aarch64-normal-server-release/images/j2sdk-image - ../apache-maven-3.8.8/bin/mvn package - mkdir -p ../build/linux-aarch64-normal-server-release/images/j2sdk-image/jre/lib/aarch64/serverless - cp -f target/serverless-adapter-0.1.jar ../build/linux-aarch64-normal-server-release/images/j2sdk-image/jre/lib/aarch64/serverless/serverless-adapter.jar - cp -f output/libloadclassagent.so ../build/linux-aarch64-normal-server-release/images/j2sdk-image/jre/lib/aarch64/serverless/ - ../build/linux-aarch64-normal-server-release/images/j2sdk-image/bin/java -version - working-directory: serverless-adapter-jdk8 - - name: Upload Test image - uses: actions/upload-artifact@v2 - with: - name: dragonwell8_aarch64_release_image_${{ needs.prerequisites.outputs.bundle_id }} - path: | - build/linux-aarch64-normal-server-release/images/j2sdk-image - - linux_aarch64_debug_build: - needs: prerequisites - name: Linux aarch64(fastdebug) - runs-on: ["ubuntu", "ARM64"] - steps: - - name: Update apt and download dependency - run: | - sudo apt update -y - sudo apt install -y libxtst-dev libxt-dev libxrender-dev libxrandr-dev libxi-dev libcups2-dev libfontconfig1-dev libasound2-dev unzip zip openjdk-8-jdk - - name: Get boot jdk - run: | - if [ ! -f /home/${USER}/dragonwell8/dragonwell-8.15.16/bin/java ];then - mkdir -p /home/${USER}/dragonwell8 - rm -rf /home/${USER}/dragonwell8/* /home/${USER}/dragonwell8.tar.gz - wget https://dragonwell.oss-cn-shanghai.aliyuncs.com/8.15.16/Alibaba_Dragonwell_Extended_8.15.16_aarch64_linux.tar.gz -O /home/${USER}/dragonwell8.tar.gz - tar zxf /home/${USER}/dragonwell8.tar.gz -C /home/${USER}/dragonwell8 - fi - - name: Checkout target source - uses: actions/checkout@v3 - with: - ref: ${{ github.event.pull_request.head.sha }} - - name: Compile debug - run: | - sh configure --with-debug-level=fastdebug --with-cacerts-file=${PWD}/common/security/cacerts --with-milestone=fcs --enable-unlimited-crypto --with-boot-jdk=/home/${USER}/dragonwell8/dragonwell-8.15.16 - make images CONF=linux-aarch64-normal-server-fastdebug - - linux_aarch64_test: - name: Linux aarch64 Test - needs: - - prerequisites - - linux_aarch64_release_build - - runs-on: ["ubuntu", "ARM64"] - strategy: - fail-fast: false - matrix: - test: - - jdk/test/:jdk_tier1 - - jdk/test/:dragonwell_jdk_features - - hotspot/test/:hotspot_tier1 - - hotspot/test/:hotspot_jwarmup - - hotspot/test/:hotspot_elastic_heap - steps: - - name: Checkout target source - uses: actions/checkout@v3 - with: - ref: ${{ github.event.pull_request.head.sha }} - - name: Clear Dragonwell8 Dir - run: | - rm -rf /opt/dragonwell8 - - name: Download image - id: jtreg_restore - uses: actions/download-artifact@v2 - with: - name: dragonwell8_aarch64_release_image_${{ needs.prerequisites.outputs.bundle_id }} - path: /opt/dragonwell8 - continue-on-error: false - - name: Test image version - run: | - ls /opt/dragonwell8 - chmod -R 777 /opt/dragonwell8 - /opt/dragonwell8/bin/java -version - - name: Get jtreg image - run: | - if [ ! -f /home/${USER}/jtreg/bin/jtreg ];then - wget https://compiler-ci-bucket.oss-cn-hangzhou.aliyuncs.com/tools/jtreg_5_1_b01.zip -O /home/${USER}/jtreg_5_1_b01.zip - cd /home/${USER} - sudo apt update -y - sudo apt install -y unzip - unzip jtreg_5_1_b01.zip - fi - - name: Test - run: | - /home/${USER}/jtreg/bin/jtreg -agentvm -a -ea -esa -v:fail,error,time,nopass -jdk:/opt/dragonwell8 -exclude:"/home/${USER}/actions-runner/_work/dragonwell8/dragonwell8/hotspot/test/ProblemList.txt" -exclude:"/home/${USER}/actions-runner/_work/dragonwell8/dragonwell8/jdk/test/ProblemList.txt" "${{ matrix.test }}" - - name: Check that all tests executed successfully - run: > - if [ -n "$(cat /home/${USER}/actions-runner/_work/dragonwell8/dragonwell8/JTreport/text/stats.txt | grep -E 'failed|error')" ]; then - cat /home/${USER}/actions-runner/_work/dragonwell8/dragonwell8/JTreport/newfailures.txt /home/${USER}/actions-runner/_work/dragonwell8/dragonwell8/JTreport/other_errors.txt; - exit 1 ; - fi diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000000..5e205d33b96 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,151 @@ +# +# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +name: 'Run tests' + +on: + workflow_call: + inputs: + platform: + required: true + type: string + runs-on: + required: true + type: string + bundle_id: + required: true + type: string + +jobs: + test: + name: test + runs-on: ${{fromJson(inputs.runs-on)}} + outputs: + should_run: ${{ steps.check_if_run.outputs.should_run }} + defaults: + run: + shell: bash + + strategy: + fail-fast: false + matrix: + test-name: + - 'jdk_tier1' + - 'dragonwell_jdk_features' + - 'hotspot_tier1' + - 'hotspot_jwarmup' + - 'hotspot_elastic_heap' + - 'hotspot_multi_tenant' + debug-suffix: + - '-release' + + include: + - test-name: 'jdk_tier1' + test-suite: 'jdk/test/:jdk_tier1' + + - test-name: 'dragonwell_jdk_features' + test-suite: 'jdk/test/:dragonwell_jdk_features' + + - test-name: 'hotspot_tier1' + test-suite: 'hotspot/test/:hotspot_tier1' + + - test-name: 'hotspot_jwarmup' + test-suite: 'hotspot/test/:hotspot_jwarmup' + + - test-name: 'hotspot_elastic_heap' + test-suite: 'hotspot/test/:hotspot_elastic_heap' + + - test-name: 'hotspot_multi_tenant' + test-suite: 'hotspot/test/:hotspot_multi_tenant' + + steps: + - name: 'Check if the test suite should run' + id: check_if_run + run: | + if [[ "${{ inputs.platform }}" == "windows-x64" ]]; then + case "${{ matrix.test-name }}" in + "jdk_tier1"|"dragonwell_jdk_features"|"hotspot_tier1"|"hotspot_jwarmup"|"hotspot_elastic_heap"|"hotspot_multi_tenant") + echo "should_run=true" >> $GITHUB_OUTPUT + ;; + *) + echo "should_run=false" >> $GITHUB_OUTPUT + ;; + esac + elif [[ "${{ inputs.platform }}" == "linux-x86_64" ]] || [[ "${{ inputs.platform }}" == "linux-aarch64" ]]; then + echo "should_run=true" >> $GITHUB_OUTPUT + else + echo "should_run=false" >> $GITHUB_OUTPUT + fi + shell: bash + + - name: 'Checkout the JDK source' + uses: actions/checkout@v4 + if: steps.check_if_run.outputs.should_run != 'false' + + - name: 'Get JTReg' + id: jtreg + uses: ./.github/actions/get-jtreg + if: steps.check_if_run.outputs.should_run != 'false' + + - name: 'Get bundles' + id: bundles + uses: ./.github/actions/get-bundles + with: + platform: ${{ inputs.platform }} + debug-suffix: ${{ matrix.debug-suffix }} + bundle_id: ${{ inputs.bundle_id }} + continue-on-error: true + if: steps.check_if_run.outputs.should_run != 'false' + + - name: 'Set PATH' + id: path + run: | + # We need a minimal PATH on Windows + # Set PATH to "", so just GITHUB_PATH is included + if [[ '${{ runner.os }}' == 'Windows' ]]; then + echo "value=" >> $GITHUB_OUTPUT + else + echo "value=$PATH" >> $GITHUB_OUTPUT + fi + if: steps.check_if_run.outputs.should_run != 'false' + + - name: 'Run tests' + id: run-tests + run: > + ${{ steps.jtreg.outputs.path }}/bin/jtreg + -agentvm -a -ea -esa -v:fail,error,time,nopass + -jdk:${{ steps.bundles.outputs.jdk }} + -exclude:"${GITHUB_WORKSPACE}/hotspot/test/ProblemList.txt" + -exclude:"${GITHUB_WORKSPACE}/jdk/test/ProblemList.txt" + ${{ matrix.test-suite }} + if: steps.check_if_run.outputs.should_run != 'false' + + - name: Check that all tests executed successfully + run: > + if [[ egrep -q "(failed|error)" ${GITHUB_WORKSPACE}/JTreport/text/stats.txt ]]; then + cat ${GITHUB_WORKSPACE}/JTreport/newfailures.txt ${GITHUB_WORKSPACE}/JTreport/other_errors.txt; + exit 1 ; + fi + if: steps.check_if_run.outputs.should_run != 'false'