diff --git a/.github/actions/build-serverless-adapter/action.yml b/.github/actions/build-serverless-adapter/action.yml new file mode 100644 index 00000000000..c1799254807 --- /dev/null +++ b/.github/actions/build-serverless-adapter/action.yml @@ -0,0 +1,98 @@ +# +## Copyright (c) 2019 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: + platform: + description: 'Platform name' + required: true + debug-suffix: + description: 'File name suffix denoting debug level, possibly empty' + required: false + +runs: + using: composite + steps: + - name: 'Found bundle' + id: bundle_found + run: | + # Only support linux now. + jdk_bundle_tar_gz="$(ls build/*/bundles/jdk-*_bin${{ inputs.debug-suffix }}.tar.gz 2> /dev/null || true)" + + echo "jdk_bundle_tar_gz: $jdk_bundle_tar_gz" + if [[ "$jdk_bundle_tar_gz" != "" ]]; then + jdk_bundle_name=${jdk_bundle_tar_gz##*/} + echo "jdk_pkg=$jdk_bundle_tar_gz" >> $GITHUB_OUTPUT + echo "jdk_pkg_name=$jdk_bundle_name" >> $GITHUB_OUTPUT + echo "decompress_cmd='tar zxf'" >> $GITHUB_OUTPUT + echo "compress_cmd='tar zcf'" >> $GITHUB_OUTPUT + else + echo "jdk_pkg=" >> $GITHUB_OUTPUT + echo "jdk_pkg_name=" >> $GITHUB_OUTPUT + echo "decompress_cmd=" >> $GITHUB_OUTPUT + echo "compress_cmd=" >> $GITHUB_OUTPUT + fi + echo $GITHUB_OUTPUT + shell: bash + + - name: 'Bundle decompression' + id: bundle_decompress + run: | + mkdir -p bundle_workdir + cd bundle_workdir + ${{ steps.bundle_found.decompress_cmd }} ${{ steps.bundle_found.jdk_pkg }} + cd - + java_path="$(ls bundle_workdir/*/bin/java 2> /dev/null || true)" + java_home=${java_path%%'/bin'*} + echo "path=bundle_workdir" >> $GITHUB_OUTPUT + echo "java_home=$java_home" >> $GITHUB_OUTPUT + shell: bash + if: steps.bundle_found.outputs.jdk_pkg != '' && steps.bundle_found.outputs.decompress_cmd != '' + + - name: 'Checkout serverless-adapter source code' + id: serverless_adapter_checkout + uses: actions/checkout@v3 + with: + repository: dragonwell-project/serverless-adapter + ref: main + path: serverless-adapter + + - name: 'Build serverless-adapter' + id: serverless_adapter_build + run: | + JAVA_HOME=${{ steps.bundle_decompress.outputs.java_home }};PATH=${{ steps.bundle_decompress.outputs.java_home }}/bin:${{ env.PATH }} mvn package + shell: bash + working-directory: serverless-adapter + + - name: 'Copy serverless-adapter into boot jdk' + run: | + mkdir -p ${{ steps.bundle_decompress.outputs.java_home }}/lib/serverless + cp -f serverless-adapter/target/serverless-adapter-0.1.jar ${{ steps.bundle_decompress.outputs.java_home }}/lib/serverless/serverless-adapter.jar + cp -f serverless-adapter/output/libloadclassagent.so ${{ steps.bundle_decompress.outputs.java_home }}/lib/serverless/libloadclassagent.so + shell: bash + + - name: 'Regenerate bundle' + run: | + cd ${{ steps.bundle_decompress.outputs.java_home }} + ${{ steps.bundle_found.outputs.compress_cmd }} ${{ steps.bundle_found.outputs.jdk_pkg_name }} * + mv -f ${{ steps.bundle_found.outputs.jdk_pkg_name }} ${{ steps.bundle_found.outputs.jdk_pkg }} + shell: bash diff --git a/.github/actions/config/action.yml b/.github/actions/config/action.yml index 5f648ffc022..50d34126bd3 100644 --- a/.github/actions/config/action.yml +++ b/.github/actions/config/action.yml @@ -43,4 +43,6 @@ runs: # Extract value from configuration file value="$(grep -h ${{ inputs.var }}= make/conf/github-actions.conf | cut -d '=' -f 2-)" echo "value=$value" >> $GITHUB_OUTPUT + dragonwell_value="$(grep -h ${{ inputs.var }}= make/conf/test-dependencies | cut -d '=' -f 2-)" + echo "value=$value" >> $GITHUB_OUTPUT shell: bash diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index 646ac5ed3a6..dc360b04540 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -80,7 +80,7 @@ jobs: - name: 'Checkout the JDK source' uses: actions/checkout@v4 - - name: 'Get the BootJDK' + - name: 'Get boot JDK' id: bootjdk uses: ./.github/actions/get-bootjdk with: @@ -116,6 +116,7 @@ jobs: --with-conf-name=${{ inputs.platform }} ${{ matrix.flags }} --with-version-opt=${GITHUB_ACTOR}-${GITHUB_SHA} + --with-version-build=0 --with-boot-jdk=${{ steps.bootjdk.outputs.path }} --with-jtreg=${{ steps.jtreg.outputs.path }} --enable-jtreg-failure-handler @@ -133,6 +134,14 @@ jobs: platform: ${{ inputs.platform }} debug-suffix: '${{ matrix.suffix }}' + - name: 'Build serverless-adapter' + id: build-serverless-adapter + uses: ./.github/actions/build-serverless-adapter + with: + platform: ${{ inputs.platform }} + debug-suffix: '${{ matrix.suffix }}' + # if: ${{ matrix.suffix }} == '' + - name: 'Upload bundles' uses: ./.github/actions/upload-bundles with: diff --git a/.github/workflows/check_pr.yml b/.github/workflows/check_pr.yml index 04f7905ca77..d7f7a67e644 100644 --- a/.github/workflows/check_pr.yml +++ b/.github/workflows/check_pr.yml @@ -19,91 +19,131 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. # -name: Dragonwell_11_build_test +name: Prerequisites -on: [pull_request] +on: + workflow_call: + inputs: + platforms: + required: true + type: string jobs: 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' - build_release_amd64_jdk: + prerequisites: + name: 'Prerequisites' runs-on: ubuntu-latest - container: - image: docker.io/alibabadragonwelljdk/build_jdk:11-latest + outputs: + should_run: ${{ steps.check_submit.outputs.should_run }} + bundle_id: ${{ steps.check_bundle_id.outputs.bundle_id }} + jdk_version: ${{ steps.check_jdk_versions.outputs.jdk_version }} + 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 }} + dependencies: ${{ steps.check_deps.outputs.dependencies }} + steps: - - uses: actions/checkout@v2 - - name: Compile release mode on amd64 - run: | - chmod 755 configure - bash make.sh release + - name: 'Check if submit tests should actually run depending on secrets and manual triggering' + id: check_submit + run: echo "::set-output name=should_run::${{ github.event.inputs.platforms != '' || (!secrets.JDK_SUBMIT_FILTER || startsWith(github.ref, 'refs/heads/submit/')) }}" - - name: Sanity test + - name: 'Check which platforms should be included' + id: check_platforms run: | - TEST_JDK_HOME=build/linux-x86_64-normal-server-release/images/jdk - ${TEST_JDK_HOME}/bin/java -version + echo "::set-output name=platform_linux_x64::${{ contains(github.event.inputs.platforms, 'linux x64') || (github.event.inputs.platforms == '') }}" + echo "::set-output name=platform_linux_aarch64::${{ contains(github.event.inputs.platforms, 'linux aarch64') || (github.event.inputs.platforms == '') }}" + echo "::set-output name=platform_windows_x64::${{ contains(github.event.inputs.platforms, 'windows x64') || (github.event.inputs.platforms == '') }}" + if: steps.check_submit.outputs.should_run != 'false' - build_release_arm64_jdk: - runs-on: [self-hosted , ARM64] - container: - image: docker.io/alibabadragonwelljdk/build_jdk:11-latest - steps: - - uses: actions/checkout@v2 - - name: Compile release mode on arm64 - run: | - chmod 755 configure - bash make.sh release + - 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' - - name: Sanity test - run: | - TEST_JDK_HOME=build/linux-aarch64-normal-server-release/images/jdk - ${TEST_JDK_HOME}/bin/java -version + - name: 'Checkout the source' + uses: actions/checkout@v3 + with: + path: jdk + if: steps.check_submit.outputs.should_run != 'false' - build_fastdebug_amd64_jdk: - runs-on: ubuntu-latest - container: - image: docker.io/alibabadragonwelljdk/build_jdk:11-latest - steps: - - uses: actions/checkout@v2 - - name: Compile slowdebug mode - run: | - chmod 755 configure - bash make.sh fastdebug + - name: 'Determine versions and locations to be used for dependencies' + id: check_deps + run: "echo ::set-output name=dependencies::`cat make/autoconf/version-numbers make/conf/test-dependencies | sed -e '1i {' -e 's/#.*//g' -e 's/\"//g' -e 's/\\(.*\\)=\\(.*\\)/\"\\1\": \"\\2\",/g' -e '$s/,\\s\\{0,\\}$/\\}/'`" + working-directory: jdk + if: steps.check_submit.outputs.should_run != 'false' - - name: Sanity test - run: | - TEST_JDK_HOME=build/linux-x86_64-normal-server-fastdebug/images/jdk - ${TEST_JDK_HOME}/bin/java -version + - name: 'Print extracted dependencies to the log' + run: "echo '${{ steps.check_deps.outputs.dependencies }}'" + if: steps.check_submit.outputs.should_run != 'false' - build_slowdebug_amd64_jdk: - runs-on: ubuntu-latest - container: - image: docker.io/alibabadragonwelljdk/build_jdk:11-latest - steps: - - uses: actions/checkout@v2 - - name: Compile slowdebug mode + - name: 'Determine full JDK versions' + id: check_jdk_versions + shell: bash run: | - chmod 755 configure - bash make.sh debug + FEATURE=${{ fromJson(steps.check_deps.outputs.dependencies).DEFAULT_VERSION_FEATURE }} + INTERIM=${{ fromJson(steps.check_deps.outputs.dependencies).DEFAULT_VERSION_INTERIM }} + UPDATE=${{ fromJson(steps.check_deps.outputs.dependencies).DEFAULT_VERSION_UPDATE }} + PATCH=${{ fromJson(steps.check_deps.outputs.dependencies).DEFAULT_VERSION_PATCH }} + if [ "x${PATCH}" != "x0" ]; then + V=${FEATURE}.${INTERIM}.${UPDATE}.${PATCH} + elif [ "x${UPDATE}" != "x0" ]; then + V=${FEATURE}.${INTERIM}.${UPDATE} + elif [ "x${INTERIM}" != "x0" ]; then + V={FEATURE}.${INTERIM} + else + V=${FEATURE} + fi + echo "::set-output name=jdk_version::${V}" + if: steps.check_submit.outputs.should_run != 'false' - - name: Sanity test - run: | - TEST_JDK_HOME=build/linux-x86_64-normal-server-slowdebug/images/jdk - ${TEST_JDK_HOME}/bin/java -version + #- name: 'Determine the jtreg ref to checkout' + # run: "echo JTREG_REF=jtreg-${{ fromJson(steps.check_deps.outputs.dependencies).JTREG_VERSION }} >> $GITHUB_ENV" + # if: steps.check_submit.outputs.should_run != 'false' - build_release_riscv_jdk: - runs-on: [self-hosted , X64] - container: - image: docker.io/alibabadragonwelljdk/centos7_gcc7_build_image:latest - steps: - - uses: actions/checkout@v2 - - name: Compile release mode riscv jdk - run: | - chmod 755 configure - LD_LIBRARY_PATH=/opt/riscv_toolchain_linux/lib64 \ - PATH=/opt/riscv_toolchain_linux/bin:/usr/local/gcc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \ - bash configure --verbose --with-vendor-name=Alibaba --with-vendor-url=http://www.alibabagroup.com --with-vendor-bug-url='mailto:dragonwell_use@googlegroups.com' --with-vendor-vm-bug-url='mailto:dragonwell_use@googlegroups.com' --with-vendor-name=Alibaba --with-vendor-url=http://www.alibabagroup.com --with-vendor-bug-url='mailto:dragonwell_use@googlegroups.com' --with-vendor-vm-bug-url='mailto:dragonwell_use@googlegroups.com' --without-version-opt --without-version-pre --with-version-build=9 --with-version-patch=14 --with-boot-jdk=/usr/lib/jvm/jdk-10 --with-debug-level=release --with-native-debug-symbols=external --with-jvm-variants=server --disable-warnings-as-errors --openjdk-target=riscv64-unknown-linux-gnu --with-sysroot=/opt/fedora28_riscv_root -with-boot-jdk=/usr/lib/jvm/jdk-10 --openjdk-target=riscv64-unknown-linux-gnu --with-sysroot=/opt/fedora28_riscv_root - make images + #- name: 'Determine the jtreg version to build' + # run: echo "BUILD_VERSION=${{ fromJson(steps.check_deps.outputs.dependencies).JTREG_VERSION }}" >> $GITHUB_ENV + # if: steps.check_submit.outputs.should_run != 'false' + + #- name: 'Determine the jtreg build number to build' + # run: echo "BUILD_NUMBER=${{ fromJson(steps.check_deps.outputs.dependencies).JTREG_BUILD }}" >> $GITHUB_ENV + # if: steps.check_submit.outputs.should_run != 'false' + + #- name: 'Check if a jtreg image is present in the cache' + # id: jtreg + # uses: actions/cache@v3 + # with: + # path: ~/jtreg/ + # key: jtreg-${{ env.JTREG_REF }}-v1 + # if: steps.check_submit.outputs.should_run != 'false' + + #- name: 'Checkout the jtreg source' + # uses: actions/checkout@v3 + # with: + # repository: "openjdk/jtreg" + # ref: ${{ env.JTREG_REF }} + # path: jtreg + # if: steps.check_submit.outputs.should_run != 'false' && steps.jtreg.outputs.cache-hit != 'true' + + #- name: 'Build jtreg' + # run: bash make/build.sh --jdk ${JAVA_HOME_8_X64} + # working-directory: jtreg + # if: steps.check_submit.outputs.should_run != 'false' && steps.jtreg.outputs.cache-hit != 'true' + + #- name: 'Move jtreg image to destination folder' + # run: mv build/images/jtreg ~/ + # working-directory: jtreg + # if: steps.check_submit.outputs.should_run != 'false' && steps.jtreg.outputs.cache-hit != 'true' + + #- name: 'Store jtreg for use by later steps' + # uses: actions/upload-artifact@v3 + # with: + # name: transient_jtreg_${{ steps.check_bundle_id.outputs.bundle_id }} + # path: ~/jtreg/ + # if: steps.check_submit.outputs.should_run != 'false' diff --git a/.github/workflows/check_pr.yml.bak b/.github/workflows/check_pr.yml.bak new file mode 100644 index 00000000000..04f7905ca77 --- /dev/null +++ b/.github/workflows/check_pr.yml.bak @@ -0,0 +1,109 @@ +# +# Copyright (c) 2019 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_11_build_test + +on: [pull_request] + +jobs: + check_commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: dragonwell-releng/check_commit_action@master + + build_release_amd64_jdk: + runs-on: ubuntu-latest + container: + image: docker.io/alibabadragonwelljdk/build_jdk:11-latest + steps: + - uses: actions/checkout@v2 + - name: Compile release mode on amd64 + run: | + chmod 755 configure + bash make.sh release + + - name: Sanity test + run: | + TEST_JDK_HOME=build/linux-x86_64-normal-server-release/images/jdk + ${TEST_JDK_HOME}/bin/java -version + + build_release_arm64_jdk: + runs-on: [self-hosted , ARM64] + container: + image: docker.io/alibabadragonwelljdk/build_jdk:11-latest + steps: + - uses: actions/checkout@v2 + - name: Compile release mode on arm64 + run: | + chmod 755 configure + bash make.sh release + + - name: Sanity test + run: | + TEST_JDK_HOME=build/linux-aarch64-normal-server-release/images/jdk + ${TEST_JDK_HOME}/bin/java -version + + build_fastdebug_amd64_jdk: + runs-on: ubuntu-latest + container: + image: docker.io/alibabadragonwelljdk/build_jdk:11-latest + steps: + - uses: actions/checkout@v2 + - name: Compile slowdebug mode + run: | + chmod 755 configure + bash make.sh fastdebug + + - name: Sanity test + run: | + TEST_JDK_HOME=build/linux-x86_64-normal-server-fastdebug/images/jdk + ${TEST_JDK_HOME}/bin/java -version + + build_slowdebug_amd64_jdk: + runs-on: ubuntu-latest + container: + image: docker.io/alibabadragonwelljdk/build_jdk:11-latest + steps: + - uses: actions/checkout@v2 + - name: Compile slowdebug mode + run: | + chmod 755 configure + bash make.sh debug + + - name: Sanity test + run: | + TEST_JDK_HOME=build/linux-x86_64-normal-server-slowdebug/images/jdk + ${TEST_JDK_HOME}/bin/java -version + + build_release_riscv_jdk: + runs-on: [self-hosted , X64] + container: + image: docker.io/alibabadragonwelljdk/centos7_gcc7_build_image:latest + steps: + - uses: actions/checkout@v2 + - name: Compile release mode riscv jdk + run: | + chmod 755 configure + LD_LIBRARY_PATH=/opt/riscv_toolchain_linux/lib64 \ + PATH=/opt/riscv_toolchain_linux/bin:/usr/local/gcc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \ + bash configure --verbose --with-vendor-name=Alibaba --with-vendor-url=http://www.alibabagroup.com --with-vendor-bug-url='mailto:dragonwell_use@googlegroups.com' --with-vendor-vm-bug-url='mailto:dragonwell_use@googlegroups.com' --with-vendor-name=Alibaba --with-vendor-url=http://www.alibabagroup.com --with-vendor-bug-url='mailto:dragonwell_use@googlegroups.com' --with-vendor-vm-bug-url='mailto:dragonwell_use@googlegroups.com' --without-version-opt --without-version-pre --with-version-build=9 --with-version-patch=14 --with-boot-jdk=/usr/lib/jvm/jdk-10 --with-debug-level=release --with-native-debug-symbols=external --with-jvm-variants=server --disable-warnings-as-errors --openjdk-target=riscv64-unknown-linux-gnu --with-sysroot=/opt/fedora28_riscv_root -with-boot-jdk=/usr/lib/jvm/jdk-10 --openjdk-target=riscv64-unknown-linux-gnu --with-sysroot=/opt/fedora28_riscv_root + make images diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8bccbadaa54..67149c441a6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,47 +1,48 @@ # -# Copyright (c) 2022, 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: 'OpenJDK GHA Sanity Checks' - -#on: -# push: -# branches-ignore: -# - master -# - pr/* -# workflow_dispatch: -# inputs: -# platforms: -# description: 'Platform(s) to execute on (comma separated, e.g. "linux-x64, macos, aarch64")' -# required: true -# default: 'linux-x64, linux-x86, linux-x64-variants, linux-cross-compile, macos-x64, macos-aarch64, windows-x64, windows-aarch64' -# configure-arguments: -# description: 'Additional configure arguments' -# required: false -# make-arguments: -# description: 'Additional make arguments' -# required: false +## Copyright (c) 2019 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 + push: + branches-ignore: + - pr/* + - dragonwell_extended-* + - dragonwell_standard-* + workflow_dispatch: + inputs: + platforms: + description: 'Platform(s) to execute on (comma separated, e.g. "linux-x64, macos, aarch64")' + required: true + #default: 'linux-x64, linux-cross-compile, windows-x64' + default: 'linux-x64' + configure-arguments: + description: 'Additional configure arguments' + required: false + make-arguments: + description: 'Additional make arguments' + required: false concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -53,69 +54,65 @@ jobs: ### Determine platforms to include ### - select: - name: 'Select platforms' - runs-on: ubuntu-22.04 - outputs: - linux-x64: ${{ steps.include.outputs.linux-x64 }} - linux-x86: ${{ steps.include.outputs.linux-x86 }} - linux-x64-variants: ${{ steps.include.outputs.linux-x64-variants }} - linux-cross-compile: ${{ steps.include.outputs.linux-cross-compile }} - macos-x64: ${{ steps.include.outputs.macos-x64 }} - macos-aarch64: ${{ steps.include.outputs.macos-aarch64 }} - windows-x64: ${{ steps.include.outputs.windows-x64 }} - windows-aarch64: ${{ steps.include.outputs.windows-aarch64 }} - - steps: - # This function must be inlined in main.yml, or we'd be forced to checkout the repo - - name: 'Check what jobs to run' - id: include - run: | - # Determine which platform jobs to run - - # Returns 'true' if the input platform list matches any of the platform monikers given as argument, - # 'false' otherwise. - # arg $1: platform name or names to look for - function check_platform() { - if [[ $GITHUB_EVENT_NAME == workflow_dispatch ]]; then - input='${{ github.event.inputs.platforms }}' - elif [[ $GITHUB_EVENT_NAME == push ]]; then - if [[ '${{ !secrets.JDK_SUBMIT_FILTER || startsWith(github.ref, 'refs/heads/submit/') }}' == 'false' ]]; then - # If JDK_SUBMIT_FILTER is set, and this is not a "submit/" branch, don't run anything - >&2 echo 'JDK_SUBMIT_FILTER is set and not a "submit/" branch' - echo 'false' - return - else - input='${{ secrets.JDK_SUBMIT_PLATFORMS }}' - fi - fi - - normalized_input="$(echo ,$input, | tr -d ' ')" - if [[ "$normalized_input" == ",," ]]; then - # For an empty input, assume all platforms should run - echo 'true' - return - else - # Check for all acceptable platform names - for part in $* ; do - if echo "$normalized_input" | grep -q -e ",$part," ; then - echo 'true' - return - fi - done - fi - - echo 'false' - } - - echo "linux-x64=$(check_platform linux-x64 linux x64)" >> $GITHUB_OUTPUT - echo "linux-x86=$(check_platform linux-x86 linux x86)" >> $GITHUB_OUTPUT - echo "linux-x64-variants=$(check_platform linux-x64-variants variants)" >> $GITHUB_OUTPUT - echo "linux-cross-compile=$(check_platform linux-cross-compile cross-compile)" >> $GITHUB_OUTPUT - echo "macos-x64=$(check_platform macos-x64 macos x64)" >> $GITHUB_OUTPUT - echo "macos-aarch64=$(check_platform macos-aarch64 macos aarch64)" >> $GITHUB_OUTPUT - echo "windows-x64=$(check_platform windows-x64 windows x64)" >> $GITHUB_OUTPUT - echo "windows-aarch64=$(check_platform windows-aarch64 windows aarch64)" >> $GITHUB_OUTPUT + prerequisites: + name: Prerequisites + uses: ./.github/workflows/check_pr.yml + with: + platforms: 'linux-x64' + + #select: + # name: 'Select platforms' + # runs-on: ubuntu-22.04 + # outputs: + # linux-x64: ${{ steps.include.outputs.linux-x64 }} + # linux-cross-compile: ${{ steps.include.outputs.linux-cross-compile }} + # windows-x64: ${{ steps.include.outputs.windows-x64 }} + + # steps: + # # This function must be inlined in main.yml, or we'd be forced to checkout the repo + # - name: 'Check what jobs to run' + # id: include + # run: | + # # Determine which platform jobs to run + + # # Returns 'true' if the input platform list matches any of the platform monikers given as argument, + # # 'false' otherwise. + # # arg $1: platform name or names to look for + # function check_platform() { + # if [[ $GITHUB_EVENT_NAME == workflow_dispatch ]]; then + # input='${{ github.event.inputs.platforms }}' + # elif [[ $GITHUB_EVENT_NAME == push ]]; then + # if [[ '${{ !secrets.JDK_SUBMIT_FILTER || startsWith(github.ref, 'refs/heads/submit/') }}' == 'false' ]]; then + # # If JDK_SUBMIT_FILTER is set, and this is not a "submit/" branch, don't run anything + # >&2 echo 'JDK_SUBMIT_FILTER is set and not a "submit/" branch' + # echo 'false' + # return + # else + # input='${{ secrets.JDK_SUBMIT_PLATFORMS }}' + # fi + # fi + + # normalized_input="$(echo ,$input, | tr -d ' ')" + # if [[ "$normalized_input" == ",," ]]; then + # # For an empty input, assume all platforms should run + # echo 'true' + # return + # else + # # Check for all acceptable platform names + # for part in $* ; do + # if echo "$normalized_input" | grep -q -e ",$part," ; then + # echo 'true' + # return + # fi + # done + # fi + + # echo 'false' + # } + + # echo "linux-x64=$(check_platform linux-x64 linux x64)" >> $GITHUB_OUTPUT + # echo "linux-cross-compile=$(check_platform linux-cross-compile cross-compile)" >> $GITHUB_OUTPUT + # echo "windows-x64=$(check_platform windows-x64 windows x64)" >> $GITHUB_OUTPUT ### ### Build jobs @@ -123,238 +120,98 @@ jobs: build-linux-x64: name: linux-x64 - needs: select - uses: ./.github/workflows/build-linux.yml - with: - platform: linux-x64 - gcc-major-version: '10' - configure-arguments: ${{ github.event.inputs.configure-arguments }} - make-arguments: ${{ github.event.inputs.make-arguments }} - # The linux-x64 jdk bundle is used as buildjdk for the cross-compile job - if: needs.select.outputs.linux-x64 == 'true' || needs.select.outputs.linux-cross-compile == 'true' - - build-linux-x86: - name: linux-x86 - needs: select - uses: ./.github/workflows/build-linux.yml - with: - platform: linux-x86 - gcc-major-version: '10' - gcc-package-suffix: '-multilib' - apt-architecture: 'i386' - # Some multilib libraries do not have proper inter-dependencies, so we have to - # install their dependencies manually. - apt-extra-packages: 'libfreetype-dev:i386 libtiff-dev:i386 libcupsimage2-dev:i386' - extra-conf-options: '--with-target-bits=32' - configure-arguments: ${{ github.event.inputs.configure-arguments }} - make-arguments: ${{ github.event.inputs.make-arguments }} - if: needs.select.outputs.linux-x86 == 'true' - - build-linux-x64-hs-nopch: - name: linux-x64-hs-nopch - needs: select - uses: ./.github/workflows/build-linux.yml - with: - platform: linux-x64 - make-target: 'hotspot' - debug-levels: '[ "debug" ]' - gcc-major-version: '10' - extra-conf-options: '--disable-precompiled-headers' - configure-arguments: ${{ github.event.inputs.configure-arguments }} - make-arguments: ${{ github.event.inputs.make-arguments }} - if: needs.select.outputs.linux-x64-variants == 'true' - - build-linux-x64-hs-zero: - name: linux-x64-hs-zero - needs: select + needs: prerequisites uses: ./.github/workflows/build-linux.yml with: platform: linux-x64 - make-target: 'hotspot' - debug-levels: '[ "debug" ]' gcc-major-version: '10' - extra-conf-options: '--with-jvm-variants=zero --disable-precompiled-headers' configure-arguments: ${{ github.event.inputs.configure-arguments }} make-arguments: ${{ github.event.inputs.make-arguments }} - if: needs.select.outputs.linux-x64-variants == 'true' - - build-linux-x64-hs-minimal: - name: linux-x64-hs-minimal - needs: select - uses: ./.github/workflows/build-linux.yml - with: - platform: linux-x64 - make-target: 'hotspot' - debug-levels: '[ "debug" ]' - gcc-major-version: '10' - extra-conf-options: '--with-jvm-variants=minimal --disable-precompiled-headers' - configure-arguments: ${{ github.event.inputs.configure-arguments }} - make-arguments: ${{ github.event.inputs.make-arguments }} - if: needs.select.outputs.linux-x64-variants == 'true' - - build-linux-x64-hs-optimized: - name: linux-x64-hs-optimized - needs: select - uses: ./.github/workflows/build-linux.yml - with: - platform: linux-x64 - make-target: 'hotspot' - # Technically this is not the "debug" level, but we can't inject a new matrix state for just this job - debug-levels: '[ "debug" ]' - gcc-major-version: '10' - extra-conf-options: '--with-debug-level=optimized --disable-precompiled-headers' - configure-arguments: ${{ github.event.inputs.configure-arguments }} - make-arguments: ${{ github.event.inputs.make-arguments }} - if: needs.select.outputs.linux-x64-variants == 'true' - - build-linux-cross-compile: - name: linux-cross-compile - needs: - - select - - build-linux-x64 - uses: ./.github/workflows/build-cross-compile.yml - with: - gcc-major-version: '10' - configure-arguments: ${{ github.event.inputs.configure-arguments }} - make-arguments: ${{ github.event.inputs.make-arguments }} - if: needs.select.outputs.linux-cross-compile == 'true' - - build-macos-x64: - name: macos-x64 - needs: select - uses: ./.github/workflows/build-macos.yml - with: - platform: macos-x64 - xcode-toolset-version: '11.7' - configure-arguments: ${{ github.event.inputs.configure-arguments }} - make-arguments: ${{ github.event.inputs.make-arguments }} - if: needs.select.outputs.macos-x64 == 'true' - - build-macos-aarch64: - name: macos-aarch64 - needs: select - uses: ./.github/workflows/build-macos.yml - with: - platform: macos-aarch64 - xcode-toolset-version: '12.4' - extra-conf-options: '--openjdk-target=aarch64-apple-darwin' - configure-arguments: ${{ github.event.inputs.configure-arguments }} - make-arguments: ${{ github.event.inputs.make-arguments }} - if: needs.select.outputs.macos-aarch64 == 'true' - - build-windows-x64: - name: windows-x64 - needs: select - uses: ./.github/workflows/build-windows.yml - with: - platform: windows-x64 - msvc-toolset-version: '14.29' - msvc-toolset-architecture: 'x86.x64' - configure-arguments: ${{ github.event.inputs.configure-arguments }} - make-arguments: ${{ github.event.inputs.make-arguments }} - if: needs.select.outputs.windows-x64 == 'true' - - build-windows-aarch64: - name: windows-aarch64 - needs: select - uses: ./.github/workflows/build-windows.yml - with: - platform: windows-aarch64 - msvc-toolset-version: '14.29' - msvc-toolset-architecture: 'arm64' - make-target: 'hotspot' - extra-conf-options: '--openjdk-target=aarch64-unknown-cygwin' - configure-arguments: ${{ github.event.inputs.configure-arguments }} - make-arguments: ${{ github.event.inputs.make-arguments }} - if: needs.select.outputs.windows-aarch64 == 'true' - - ### - ### Test jobs - ### - - test-linux-x64: - name: linux-x64 - needs: - - build-linux-x64 - uses: ./.github/workflows/test.yml - with: - platform: linux-x64 - bootjdk-platform: linux-x64 - runs-on: ubuntu-22.04 - - test-linux-x86: - name: linux-x86 - needs: - - build-linux-x86 - uses: ./.github/workflows/test.yml - with: - platform: linux-x86 - bootjdk-platform: linux-x64 - runs-on: ubuntu-22.04 - - test-macos-x64: - name: macos-x64 - needs: - - build-macos-x64 - uses: ./.github/workflows/test.yml - with: - platform: macos-x64 - bootjdk-platform: macos-x64 - runs-on: macos-11 - - test-windows-x64: - name: windows-x64 - needs: - - build-windows-x64 - uses: ./.github/workflows/test.yml - with: - platform: windows-x64 - bootjdk-platform: windows-x64 - runs-on: windows-2019 - - # Remove bundles so they are not misconstrued as binary distributions from the JDK project - remove-bundles: - name: 'Remove bundle artifacts' - runs-on: ubuntu-22.04 - if: always() - needs: - - build-linux-x64 - - build-linux-x86 - - build-linux-x64-hs-nopch - - build-linux-x64-hs-zero - - build-linux-x64-hs-minimal - - build-linux-x64-hs-optimized - - build-linux-cross-compile - - build-macos-x64 - - build-macos-aarch64 - - build-windows-x64 - - build-windows-aarch64 - - test-linux-x64 - - test-linux-x86 - - test-macos-x64 - - test-windows-x64 - - steps: - # Hack to get hold of the api environment variables that are only defined for actions - - name: 'Get API configuration' - id: api - uses: actions/github-script@v6 - with: - script: 'return { url: process.env["ACTIONS_RUNTIME_URL"], token: process.env["ACTIONS_RUNTIME_TOKEN"] }' - - - name: 'Remove bundle artifacts' - run: | - # Find and remove all bundle artifacts - ALL_ARTIFACT_URLS="$(curl -s \ - -H 'Accept: application/json;api-version=6.0-preview' \ - -H 'Authorization: Bearer ${{ fromJson(steps.api.outputs.result).token }}' \ - '${{ fromJson(steps.api.outputs.result).url }}_apis/pipelines/workflows/${{ github.run_id }}/artifacts?api-version=6.0-preview')" - BUNDLE_ARTIFACT_URLS="$(echo "$ALL_ARTIFACT_URLS" | jq -r -c '.value | map(select(.name|startswith("bundles-"))) | .[].url')" - for url in $BUNDLE_ARTIFACT_URLS; do - echo "Removing $url" - curl -s \ - -H 'Accept: application/json;api-version=6.0-preview' \ - -H 'Authorization: Bearer ${{ fromJson(steps.api.outputs.result).token }}' \ - -X DELETE "$url" \ - || echo "Failed to remove bundle" - done + extra-conf-options: --with-default-make-target="product-bundles test-bundles" --with-jvm-features=shenandoahgc + make-target: CONF_NAME=linux-x64 + if: needs.prerequisites.outputs.should_run != 'false' && needs.prerequisites.outputs.platform_linux_x64 != 'false' + +# build-linux-cross-compile: +# name: linux-cross-compile +# needs: +# - select +# - build-linux-x64 +# uses: ./.github/workflows/build-cross-compile.yml +# with: +# gcc-major-version: '10' +# configure-arguments: ${{ github.event.inputs.configure-arguments }} +# make-arguments: ${{ github.event.inputs.make-arguments }} +# if: needs.select.outputs.linux-cross-compile == 'true' +# +# build-windows-x64: +# name: windows-x64 +# needs: select +# uses: ./.github/workflows/build-windows.yml +# with: +# platform: windows-x64 +# msvc-toolset-version: '14.29' +# msvc-toolset-architecture: 'x86.x64' +# configure-arguments: ${{ github.event.inputs.configure-arguments }} +# make-arguments: ${{ github.event.inputs.make-arguments }} +# if: needs.select.outputs.windows-x64 == 'true' +# +# ### +# ### Test jobs +# ### +# +# test-linux-x64: +# name: linux-x64 +# needs: +# - build-linux-x64 +# uses: ./.github/workflows/test.yml +# with: +# platform: linux-x64 +# bootjdk-platform: linux-x64 +# runs-on: ubuntu-22.04 +# +# test-windows-x64: +# name: windows-x64 +# needs: +# - build-windows-x64 +# uses: ./.github/workflows/test.yml +# with: +# platform: windows-x64 +# bootjdk-platform: windows-x64 +# runs-on: windows-2019 +# +# # Remove bundles so they are not misconstrued as binary distributions from the JDK project +# remove-bundles: +# name: 'Remove bundle artifacts' +# runs-on: ubuntu-22.04 +# if: always() +# needs: +# - build-linux-x64 +# - build-linux-cross-compile +# - build-windows-x64 +# - test-linux-x64 +# - test-windows-x64 +# +# steps: +# # Hack to get hold of the api environment variables that are only defined for actions +# - name: 'Get API configuration' +# id: api +# uses: actions/github-script@v6 +# with: +# script: 'return { url: process.env["ACTIONS_RUNTIME_URL"], token: process.env["ACTIONS_RUNTIME_TOKEN"] }' +# +# - name: 'Remove bundle artifacts' +# run: | +# # Find and remove all bundle artifacts +# ALL_ARTIFACT_URLS="$(curl -s \ +# -H 'Accept: application/json;api-version=6.0-preview' \ +# -H 'Authorization: Bearer ${{ fromJson(steps.api.outputs.result).token }}' \ +# '${{ fromJson(steps.api.outputs.result).url }}_apis/pipelines/workflows/${{ github.run_id }}/artifacts?api-version=6.0-preview')" +# BUNDLE_ARTIFACT_URLS="$(echo "$ALL_ARTIFACT_URLS" | jq -r -c '.value | map(select(.name|startswith("bundles-"))) | .[].url')" +# for url in $BUNDLE_ARTIFACT_URLS; do +# echo "Removing $url" +# curl -s \ +# -H 'Accept: application/json;api-version=6.0-preview' \ +# -H 'Authorization: Bearer ${{ fromJson(steps.api.outputs.result).token }}' \ +# -X DELETE "$url" \ +# || echo "Failed to remove bundle" +# done diff --git a/.github/workflows/submit.yml b/.github/workflows/submit.yml.bak similarity index 100% rename from .github/workflows/submit.yml rename to .github/workflows/submit.yml.bak diff --git a/make/conf/test-dependencies b/make/conf/test-dependencies index ead47aeb750..ce9cc808e4b 100644 --- a/make/conf/test-dependencies +++ b/make/conf/test-dependencies @@ -30,18 +30,22 @@ JTREG_VERSION=6.1+3 JTREG_BUILD=1 GTEST_VERSION=1.8.1 +LINUX_X64_BOOT_JDK_EXT=tar.gz LINUX_X64_BOOT_JDK_FILENAME=openjdk-11.0.14.1_linux-x64_bin.tar.gz LINUX_X64_BOOT_JDK_URL=https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.14.1%2B1/OpenJDK11U-jdk_x64_linux_hotspot_11.0.14.1_1.tar.gz LINUX_X64_BOOT_JDK_SHA256=43fb84f8063ad9bf6b6d694a67b8f64c8827552b920ec5ce794dfe5602edffe7 +LINUX_AARCH64_BOOT_JDK_EXT=tar.gz LINUX_AARCH64_BOOT_JDK_FILENAME=openjdk-11.0.14.1_linux-aarch64_bin.tar.gz LINUX_AARCH64_BOOT_JDK_URL=https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.14.1%2B1/OpenJDK11U-jdk_aarch64_linux_hotspot_11.0.14.1_1.tar.gz LINUX_AARCH64_BOOT_JDK_SHA256=79572f5172c6a040591d34632f98a20ed148702bbce2f57649e8ac01c0d2e3db +WINDOWS_X64_BOOT_JDK_EXT=zip WINDOWS_X64_BOOT_JDK_FILENAME=openjdk-11.0.14.1_windows-x64_bin.zip WINDOWS_X64_BOOT_JDK_URL=https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.14.1%2B1/OpenJDK11U-jdk_x64_windows_hotspot_11.0.14.1_1.zip WINDOWS_X64_BOOT_JDK_SHA256=3e7da701aa92e441418299714f0ed6db10c3bb1e2db625c35a2c2cd9cc619731 +MACOS_X64_BOOT_JDK_EXT=tar.gz MACOS_X64_BOOT_JDK_FILENAME=openjdk-11.0.14.1_osx-x64_bin.tar.gz MACOS_X64_BOOT_JDK_URL=https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.14.1%2B1/OpenJDK11U-jdk_x64_mac_hotspot_11.0.14.1_1.tar.gz MACOS_X64_BOOT_JDK_SHA256=8c69808f5d9d209b195575e979de0e43cdf5d0f1acec1853a569601fe2c1f743