diff --git a/.github/actions/build-serverless-adapter/action.yml b/.github/actions/build-serverless-adapter/action.yml new file mode 100644 index 00000000000..75c7365afb8 --- /dev/null +++ b/.github/actions/build-serverless-adapter/action.yml @@ -0,0 +1,72 @@ +# +# 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: + jdk: + description: 'Boot JDK' + required: true + platform: + description: 'Boot JDK' + 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: 'Get Maven' + id: maven + run: | + mkdir -p /opt/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 /opt/maven --strip-components=1 + echo "::set-output name=path::/opt/maven" + shell: bash + + - name: 'Build serverless-adapter' + id: serverless_adapter_build + run: | + export PATH=${{ inputs.jdk }}/bin:${{ steps.maven.outputs.path }}/bin:${PATH} + JAVA_HOME=${{ inputs.jdk }} mvn package + echo "::set-output name=path::${PWD}" + shell: bash + working-directory: serverless-adapter + + - name: 'Copy serverless-adapter into boot jdk' + run: | + if [ "${{ inputs.platform }}" = "linux-x64" ]; then + subdir='amd64' + else + subdir="aarch64" + fi + target_path=${{ inputs.jdk }}/jre/lib/${subdir}/serverless + mkdir -p ${target_path} + cp -f ${{ steps.serverless_adapter_build.outputs.path }}/target/serverless-adapter-0.1.jar ${target_path}/serverless-adapter.jar + cp -f ${{ steps.serverless_adapter_build.outputs.path }}/output/libloadclassagent.so ${target_path}/libloadclassagent.so + shell: bash diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml new file mode 100644 index 00000000000..a53307a9254 --- /dev/null +++ b/.github/workflows/build-linux.yml @@ -0,0 +1,153 @@ +# +# 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 + extra-conf-options: + required: false + type: string + make-target: + required: false + type: string + default: 'product-bundles test-bundles' + debug-levels: + required: false + type: string + default: '[ "fastdebug", "release" ]' + gcc-major-version: + required: false + type: string + gcc-package-suffix: + required: false + type: string + default: '' + apt-architecture: + required: false + type: string + apt-extra-packages: + required: false + type: string + configure-arguments: + required: false + type: string + conf-arguments: + required: false + type: string + runs-on: + required: true + type: string + +jobs: + build-linux: + name: build + runs-on: ${{fromJson(inputs.runs-on)}} + + strategy: + fail-fast: false + matrix: + debug-level: ${{ fromJSON(inputs.debug-levels) }} + include: + - debug-level: release + flags: --with-debug-level=release + suffix: -release + - debug-level: fastdebug + flags: --with-debug-level=fastdebug + suffix: -fastdebug + steps: + - name: 'Checkout the JDK source' + uses: actions/checkout@v4 + + - name: 'Update apt and download dependency' + run: | + sudo apt update -y + sudo apt install -y gcc-9 g++-9 libxtst-dev libxt-dev libxrender-dev libxrandr-dev libxi-dev libcups2-dev libfontconfig1-dev libasound2-dev unzip zip wget + if: inputs.platform != 'linux-aarch64' + + - name: 'Get boot JDK' + id: bootjdk + run: | + if [ "${{ inputs.platform }}" = "linux-x64" ]; then + url=https://dragonwell.oss-cn-shanghai.aliyuncs.com/8.19.20/Alibaba_Dragonwell_Extended_8.19.20_x64_linux.tar.gz + else + url=https://dragonwell.oss-cn-shanghai.aliyuncs.com/8.19.20/Alibaba_Dragonwell_Extended_8.19.20_aarch64_linux.tar.gz + fi + wget ${url} -O jdk.tar.gz + mkdir -p ${PWD}/jdk-8 + tar zxvf jdk.tar.gz -C ${PWD}/jdk-8/ --strip-components=1 + rm -rf jdk.tar.gz + echo "::set-output name=path::${PWD}/jdk-8" + shell: bash + + - name: 'Clean' + run: | + if [ -d build ] ;then + rm -rf build + fi + shell: bash + + - name: 'Configure' + run: > + bash configure + --with-conf-name=${{ inputs.conf-arguments }}${{ matrix.suffix }} + ${{ matrix.flags }} + --with-boot-jdk=${{ steps.bootjdk.outputs.path }} + --with-cacerts-file=${PWD}/common/security/cacerts + --with-milestone=fcs + --enable-unlimited-crypto || ( + echo "Dumping config.log:" && + cat config.log && + exit 1) + shell: bash + + - name: 'Build' + id: build + run: | + make clean + make ${{ inputs.make-target }} CONF=${{ inputs.conf-arguments }}${{ matrix.suffix }} + echo "::set-output name=path::${PWD}/build/${{ inputs.conf-arguments }}${{ matrix.suffix }}/images" + echo "::set-output name=folder::j2sdk-image" + shell: bash + + - name: 'Build Serverless Adapter' + uses: ./.github/actions/build-serverless-adapter + with: + jdk: "${{ steps.build.outputs.path }}/${{ steps.build.outputs.folder }}" + platform: "${{ inputs.platform }}" + + - name: 'Compress bundles' + id: compress_bundles + run: | + tar zcvf ${PWD}/bundles.tar.gz -C ${{ steps.build.outputs.path }} ${{ steps.build.outputs.folder }} + echo "::set-output name=path::${PWD}/bundles.tar.gz" + shell: bash + + - name: 'Upload bundles' + uses: actions/upload-artifact@v3 + with: + name: bundles-${{ inputs.platform }}${{ matrix.suffix }} + path: ${{ steps.compress_bundles.outputs.path }} + retention-days: 3 diff --git a/.github/workflows/check_pr.yml b/.github/workflows/check_pr.yml index 93ee21bb03e..5c5bb52b46c 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,56 @@ # 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 }} jobs: - check_commit: + #check_commit: + # 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 }} + 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 == '') }}" + echo "::set-output name=platform_riscv64::${{ contains(inputs.platforms, 'riscv64') || (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/submit.yml b/.github/workflows/submit.yml index f2acbafc27d..b7aa7e2b7b2 100644 --- a/.github/workflows/submit.yml +++ b/.github/workflows/submit.yml @@ -23,242 +23,310 @@ name: Dragonwell_8_build_test on: pull_request: - types: [opened, synchronize, reopened] + branches: + - master + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true 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}" + uses: ./.github/workflows/check_pr.yml + with: + platforms: 'linux x64, linux aarch64' - linux_x64_build: + build-linux-x64: + name: linux-x64 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 + uses: ./.github/workflows/build-linux.yml + with: + platform: linux-x64 + conf-arguments: linux-x86_64-normal-server + make-target: 'images' + runs-on: '"ubuntu-20.04"' + if: needs.prerequisites.outputs.should_run != 'false' && needs.prerequisites.outputs.platform_linux_x64 != 'false' - linux_x64_test: - name: Linux x64 Test - needs: - - prerequisites - - linux_x64_build + build-linux-aarch64: + name: linux-aarch64 + needs: prerequisites + uses: ./.github/workflows/build-linux.yml + with: + platform: linux-aarch64 + conf-arguments: linux-aarch64-normal-server + make-target: 'images' + runs-on: '["self-hosted", "ARM64"]' + if: needs.prerequisites.outputs.should_run != 'false' && needs.prerequisites.outputs.platform_linux_aarch64 != 'false' - 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 + test-linux-x64: + name: linux-x64 + needs: + - build-linux-x64 + uses: ./.github/workflows/test.yml + with: + platform: linux-x64 + debug-suffix: -release + runs-on: '"ubuntu-20.04"' - 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 + test-linux-aarch64: + name: linux-aarch64 + needs: + - build-linux-aarch64 + uses: ./.github/workflows/test.yml + with: + platform: linux-aarch64 + debug-suffix: -release + runs-on: '["self-hosted", "ARM64"]' - 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 + remove-bundles: + name: 'Remove bundle artifacts' + runs-on: ubuntu-22.04 - linux_aarch64_test: - name: Linux aarch64 Test needs: - - prerequisites - - linux_aarch64_release_build + - build-linux-x64 + - build-linux-aarch64 + - test-linux-x64 + - test-linux-aarch64 - 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 + - name: 'Get API configuration' + id: api + uses: actions/github-script@v6 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 + script: 'return { url: process.env["ACTIONS_RUNTIME_URL"], token: process.env["ACTIONS_RUNTIME_TOKEN"] }' + + - name: 'Remove bundle artifacts' 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 + 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 + + #linux_x64_build: + # needs: prerequisites + # name: Linux x64 + # runs-on: "ubuntu-20.04" + # steps: + # - name: Checkout target source + # uses: actions/checkout@v3 + # with: + # ref: ${{ github.event.pull_request.head.sha }} + # - 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: 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: 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: 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} + # 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..4cd1cdf89a6 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,148 @@ +# +# 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: 'Run tests' + +on: + workflow_call: + inputs: + platform: + required: true + type: string + debug-suffix: + required: false + type: string + runs-on: + 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' + + 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 }}" == "linux-x64" ]]; then + echo "should_run=true" >> $GITHUB_OUTPUT + elif [[ "${{ inputs.platform }}" == "linux-aarch64" ]]; then + if [[ "${{ matrix.test-name }}" == "hotspot_multi_tenant" ]]; then + echo "should_run=false" >> $GITHUB_OUTPUT + else + echo "should_run=true" >> $GITHUB_OUTPUT + fi + 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: 'Update independencies' + run: | + sudo apt-get update -y + sudo apt-get install openjdk-8-jdk + if: steps.check_if_run.outputs.should_run != 'false' && inputs.platform != 'linux-aarch64' + + - name: 'Get boot JDK' + id: bootjdk + run: | + if [ "${{ inputs.platform }}" = "linux-x64" ]; then + url=https://dragonwell.oss-cn-shanghai.aliyuncs.com/8.19.20/Alibaba_Dragonwell_Extended_8.19.20_x64_linux.tar.gz + else + url=https://dragonwell.oss-cn-shanghai.aliyuncs.com/8.19.20/Alibaba_Dragonwell_Extended_8.19.20_aarch64_linux.tar.gz + fi + wget ${url} -O jdk.tar.gz + mkdir -p ${PWD}/jdk-8 + tar zxvf jdk.tar.gz -C ${PWD}/jdk-8/ --strip-components=1 + rm -rf jdk.tar.gz + echo "::set-output name=path::${PWD}/jdk-8" + shell: bash + if: steps.check_if_run.outputs.should_run != 'false' + + - name: 'Get bundles' + uses: actions/download-artifact@v3 + with: + name: bundles-${{ inputs.platform }}${{ inputs.debug-suffix }} + path: bundles + if: steps.check_if_run.outputs.should_run != 'false' + + - name: 'Unpack bundles' + id: unpack_bundles + run: | + mkdir -p java_home + tar zxvf bundles/bundles.tar.gz -C java_home --strip-components=1 + echo "::set-output name=path::${PWD}/java_home" + shell: bash + if: steps.check_if_run.outputs.should_run != 'false' + + - name: 'Get jtreg' + id: get_jtreg + run: | + wget https://compiler-tools.oss-cn-hangzhou.aliyuncs.com/jtreg/jtreg-5.1-b01.tar.gz -O jtreg.tar.gz + mkdir -p jtreg + tar zxvf jtreg.tar.gz -C jtreg --strip-components=1 + rm -rf jtreg.tar.gz + echo "::set-output name=path::${PWD}/jtreg" + shell: bash + if: steps.check_if_run.outputs.should_run != 'false' + + - name: 'Run test' + run: | + cpu=`nproc` + jobs=`expr ${cpu} / 2` + ${{ steps.get_jtreg.outputs.path }}/bin/jtreg -agentvm -a -ea -esa -v:fail,error,time -jdk:${{ steps.unpack_bundles.outputs.path }} -exclude:"${PWD}/hotspot/test/ProblemList.txt" -exclude:"${PWD}/jdk/test/ProblemList.txt" -concurrency:${jobs} ${{ matrix.test-suite }} + shell: bash + if: steps.check_if_run.outputs.should_run != 'false' diff --git a/.github/workflows/upstream.yml b/.github/workflows/upstream.yml new file mode 100644 index 00000000000..51207c4aca1 --- /dev/null +++ b/.github/workflows/upstream.yml @@ -0,0 +1,301 @@ +name: Pre-submit tests + +on: + pull_request: + branches: + - master + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + prerequisites: + name: Prerequisites + runs-on: "ubuntu-20.04" + 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 }} + dependencies: ${{ steps.check_deps.outputs.dependencies }} + + steps: + - name: Check if submit tests should actually run depending on secrets and manual triggering + id: check_submit + run: echo "should_run=${{ github.event.inputs.platforms != '' || (!secrets.JDK_SUBMIT_FILTER || startsWith(github.ref, 'refs/heads/submit/')) }}" >> $GITHUB_OUTPUT + + - name: Check which platforms should be included + id: check_platforms + run: | + echo "platform_linux_additional=${{ contains(github.event.inputs.platforms, 'linux additional (hotspot only)') || (github.event.inputs.platforms == '' && (secrets.JDK_SUBMIT_PLATFORMS == '' || contains(secrets.JDK_SUBMIT_PLATFORMS, 'linux additional (hotspot only)'))) }}" >> $GITHUB_OUTPUT + echo "platform_linux_x64=${{ contains(github.event.inputs.platforms, 'linux x64') || (github.event.inputs.platforms == '' && (secrets.JDK_SUBMIT_PLATFORMS == '' || contains(secrets.JDK_SUBMIT_PLATFORMS, 'linux x64'))) }}" >> $GITHUB_OUTPUT + echo "platform_linux_x86=${{ contains(github.event.inputs.platforms, 'linux x86') || (github.event.inputs.platforms == '' && (secrets.JDK_SUBMIT_PLATFORMS == '' || contains(secrets.JDK_SUBMIT_PLATFORMS, 'linux x86'))) }}" >> $GITHUB_OUTPUT + echo "platform_windows_x64=${{ contains(github.event.inputs.platforms, 'windows x64') || (github.event.inputs.platforms == '' && (secrets.JDK_SUBMIT_PLATFORMS == '' || contains(secrets.JDK_SUBMIT_PLATFORMS, 'windows x64'))) }}" >> $GITHUB_OUTPUT + echo "platform_windows_x86=${{ contains(github.event.inputs.platforms, 'windows x86') || (github.event.inputs.platforms == '' && (secrets.JDK_SUBMIT_PLATFORMS == '' || contains(secrets.JDK_SUBMIT_PLATFORMS, 'windows x86'))) }}" >> $GITHUB_OUTPUT + echo "platform_macos_x64=${{ contains(github.event.inputs.platforms, 'macos x64') || (github.event.inputs.platforms == '' && (secrets.JDK_SUBMIT_PLATFORMS == '' || contains(secrets.JDK_SUBMIT_PLATFORMS, 'macos x64'))) }}" >> $GITHUB_OUTPUT + if: steps.check_submit.outputs.should_run != 'false' + + - name: Determine unique bundle identifier + id: check_bundle_id + run: echo "bundle_id=${GITHUB_ACTOR}_${GITHUB_SHA:0:8}" >> $GITHUB_OUTPUT + if: steps.check_submit.outputs.should_run != 'false' + + - name: Checkout the source + uses: actions/checkout@v3 + with: + path: jdk + if: steps.check_submit.outputs.should_run != 'false' + + - name: Determine versions and locations to be used for dependencies + id: check_deps + run: "echo dependencies=`cat common/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,\\}$/\\}/'` >> $GITHUB_OUTPUT" + working-directory: jdk + if: steps.check_submit.outputs.should_run != 'false' + + - name: Print extracted dependencies to the log + run: "echo '${{ steps.check_deps.outputs.dependencies }}'" + if: steps.check_submit.outputs.should_run != 'false' + + - name: Determine the jtreg ref to checkout + run: "echo JTREG_REF=jtreg${{ fromJson(steps.check_deps.outputs.dependencies).JTREG_VERSION }}-${{ fromJson(steps.check_deps.outputs.dependencies).JTREG_BUILD }} >> $GITHUB_ENV" + if: steps.check_submit.outputs.should_run != 'false' + + - 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-all.sh ${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' + + linux_x64_build: + name: Linux x64 + runs-on: "ubuntu-20.04" + needs: prerequisites + if: needs.prerequisites.outputs.should_run != 'false' && needs.prerequisites.outputs.platform_linux_x64 != 'false' + + strategy: + fail-fast: false + matrix: + flavor: + - build release + - build debug + include: + - flavor: build debug + flags: --enable-debug + artifact: -debug + + env: + JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).JDK_MAJOR_VERSION }}.${{ fromJson(needs.prerequisites.outputs.dependencies).JDK_MINOR_VERSION }}.${{ fromJson(needs.prerequisites.outputs.dependencies).JDK_MICRO_VERSION }}" + + steps: + - name: Checkout the source + uses: actions/checkout@v3 + with: + path: jdk + + - name: Restore jtreg artifact + id: jtreg_restore + uses: actions/download-artifact@v3 + with: + name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }} + path: ~/jtreg/ + continue-on-error: true + + - name: Restore jtreg artifact (retry) + uses: actions/download-artifact@v3 + with: + name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }} + path: ~/jtreg/ + if: steps.jtreg_restore.outcome == 'failure' + + - name: Fix jtreg permissions + run: chmod -R a+rx ${HOME}/jtreg/ + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install openjdk-8-jdk gcc-9 g++-9 libxrandr-dev libxtst-dev libcups2-dev libasound2-dev + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 100 --slave /usr/bin/g++ g++ /usr/bin/g++-9 + + - name: Get dragonwell + id: bootjdk + run: | + url=https://dragonwell.oss-cn-shanghai.aliyuncs.com/8.19.20/Alibaba_Dragonwell_Extended_8.19.20_x64_linux.tar.gz + wget ${url} -O jdk.tar.gz + mkdir -p ${PWD}/jdk-8 + tar zxvf jdk.tar.gz -C ${PWD}/jdk-8/ --strip-components=1 + rm -rf jdk.tar.gz + echo "::set-output name=path::${PWD}/jdk-8" + + - name: Configure + run: > + bash configure + --with-conf-name=linux-x64 + ${{ matrix.flags }} + --with-user-release-suffix=${GITHUB_ACTOR}-${GITHUB_SHA} + --with-build-number=b00 + --with-boot-jdk=${{ steps.bootjdk.outputs.path }} + --with-jtreg=${HOME}/jtreg + --with-zlib=bundled + working-directory: jdk + + - name: Build + run: make CONF_NAME=linux-x64 LOG_LEVEL=debug images + working-directory: jdk + + - name: look libjvm.so + run: | + strings build/linux-x64/images/j2sdk-image/jre/lib/amd64/server/libjvm.so | grep GLIBC + working-directory: jdk + + - name: Pack artifacts + run: | + tar -czf jdk-${{ env.JDK_VERSION }}-internal+0_linux-x64_bin${{ matrix.artifact }}.tar.gz -C jdk/build/linux-x64/images j2sdk-image + + - name: Persist test bundles + uses: actions/upload-artifact@v3 + with: + name: transient_jdk-linux-x64${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }} + path: | + jdk-${{ env.JDK_VERSION }}-internal+0_linux-x64_bin${{ matrix.artifact }}.tar.gz + + linux_x64_test: + name: Linux x64 + runs-on: "ubuntu-20.04" + needs: + - prerequisites + - linux_x64_build + + strategy: + fail-fast: false + matrix: + test: + - hotspot/tier1 + include: + - test: hotspot/tier1 + suites: hotspot_tier1 + + env: + JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).JDK_MAJOR_VERSION }}.${{ fromJson(needs.prerequisites.outputs.dependencies).JDK_MINOR_VERSION }}.${{ fromJson(needs.prerequisites.outputs.dependencies).JDK_MICRO_VERSION }}" + BOOT_JDK: "/usr/lib/jvm/java-8-openjdk-amd64" + + steps: + - name: Checkout the source + uses: actions/checkout@v3 + + - name: Restore jtreg artifact + id: jtreg_restore + uses: actions/download-artifact@v3 + with: + name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }} + path: ~/jtreg/ + continue-on-error: true + + - name: Restore jtreg artifact (retry) + uses: actions/download-artifact@v3 + with: + name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }} + path: ~/jtreg/ + if: steps.jtreg_restore.outcome == 'failure' + + - name: Restore build artifacts + id: build_restore + uses: actions/download-artifact@v3 + with: + name: transient_jdk-linux-x64${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }} + path: ~/jdk-linux-x64${{ matrix.artifact }} + continue-on-error: true + + - name: Restore build artifacts (retry) + uses: actions/download-artifact@v3 + with: + name: transient_jdk-linux-x64${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }} + path: ~/jdk-linux-x64${{ matrix.artifact }} + if: steps.build_restore.outcome == 'failure' + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install openjdk-8-jdk + + - name: Unpack jdk + run: | + mkdir -p "${HOME}/jdk-linux-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x64_bin${{ matrix.artifact }}" + tar -xzf "${HOME}/jdk-linux-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x64_bin${{ matrix.artifact }}.tar.gz" -C "${HOME}/jdk-linux-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x64_bin${{ matrix.artifact }}" + + - name: Run tests + run: > + chmod +x "${HOME}/jtreg/bin/jtreg" && + mkdir test-results && + cd test && + PRODUCT_HOME="${HOME}/jdk-linux-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x64_bin${{ matrix.artifact }}/j2sdk-image" + JT_HOME="${HOME}/jtreg" + ALT_OUTPUTDIR="${GITHUB_WORKSPACE}/test-results" + JAVA_ARGS="-Djdk.test.docker.image.name=ubuntu -Djdk.test.docker.image.version=latest" + JTREG_TIMEOUT_FACTOR="4" + make + "${{ matrix.suites }}" + + - name: Check that all tests executed successfully + if: always() + run: > + if cat test-results/testoutput/*/exitcode.txt | grep -q -v '^0$' + || ! cat test-results/testoutput/*/Stats.txt | grep -q 'fail=0' ; then + cat test-results/testoutput/*/JTreport/text/{newfailures,other_errors}.txt ; + exit 1 ; + fi + + - name: Create suitable test log artifact name + if: always() + run: echo "logsuffix=`echo ${{ matrix.test }} | sed -e 's!/!_!'g -e 's! !_!'g`" >> $GITHUB_ENV + + - name: Package test results + if: always() + working-directory: test-results + run: > + zip -r9 + "$HOME/linux-x64${{ matrix.artifact }}_testresults_${{ env.logsuffix }}.zip" + . + -x "*ARCHIVE_BUNDLE.zip" + continue-on-error: true + + - name: Persist test results + if: always() + uses: actions/upload-artifact@v3 + with: + path: ~/linux-x64${{ matrix.artifact }}_testresults_${{ env.logsuffix }}.zip + continue-on-error: true