1 name: Pre-submit tests
   2 
   3 on:
   4   push:
   5     branches-ignore:
   6       - master
   7       - pr/*
   8   workflow_dispatch:
   9     inputs:
  10       platforms:
  11         description: "Platform(s) to execute on"
  12         required: true
  13         default: "Linux additional (hotspot only), Linux x64, Linux x86, Windows aarch64, Windows x64, macOS x64"
  14 
  15 jobs:
  16   prerequisites:
  17     name: Prerequisites
  18     runs-on: "ubuntu-20.04"
  19     outputs:
  20       should_run: ${{ steps.check_submit.outputs.should_run }}
  21       bundle_id: ${{ steps.check_bundle_id.outputs.bundle_id }}
  22       platform_linux_additional: ${{ steps.check_platforms.outputs.platform_linux_additional }}
  23       platform_linux_x64: ${{ steps.check_platforms.outputs.platform_linux_x64 }}
  24       platform_linux_x86: ${{ steps.check_platforms.outputs.platform_linux_x86 }}
  25       platform_windows_aarch64: ${{ steps.check_platforms.outputs.platform_windows_aarch64 }}
  26       platform_windows_x64: ${{ steps.check_platforms.outputs.platform_windows_x64 }}
  27       platform_macos_x64: ${{ steps.check_platforms.outputs.platform_macos_x64 }}
  28       platform_macos_aarch64: ${{ steps.check_platforms.outputs.platform_macos_aarch64 }}
  29       dependencies: ${{ steps.check_deps.outputs.dependencies }}
  30 
  31     steps:
  32       - name: Check if submit tests should actually run depending on secrets and manual triggering
  33         id: check_submit
  34         run: echo "::set-output name=should_run::${{ github.event.inputs.platforms != '' || (!secrets.JDK_SUBMIT_FILTER || startsWith(github.ref, 'refs/heads/submit/')) }}"
  35 
  36       - name: Check which platforms should be included
  37         id: check_platforms
  38         run: |
  39           echo "::set-output name=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)'))) }}"
  40           echo "::set-output name=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'))) }}"
  41           echo "::set-output name=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'))) }}"
  42           echo "::set-output name=platform_windows_aarch64::${{ contains(github.event.inputs.platforms, 'windows aarch64') || (github.event.inputs.platforms == '' && (secrets.JDK_SUBMIT_PLATFORMS == '' || contains(secrets.JDK_SUBMIT_PLATFORMS, 'windows aarch64'))) }}"
  43           echo "::set-output name=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'))) }}"
  44           echo "::set-output name=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'))) }}"
  45           echo "::set-output name=platform_macos_aarch64::${{ contains(github.event.inputs.platforms, 'macos aarch64') || (github.event.inputs.platforms == '' && (secrets.JDK_SUBMIT_PLATFORMS == '' || contains(secrets.JDK_SUBMIT_PLATFORMS, 'macos aarch64'))) }}"
  46         if: steps.check_submit.outputs.should_run != 'false'
  47 
  48       - name: Determine unique bundle identifier
  49         id: check_bundle_id
  50         run: echo "::set-output name=bundle_id::${GITHUB_ACTOR}_${GITHUB_SHA:0:8}"
  51         if: steps.check_submit.outputs.should_run != 'false'
  52 
  53       - name: Checkout the source
  54         uses: actions/checkout@v2
  55         with:
  56           path: jdk
  57         if: steps.check_submit.outputs.should_run != 'false'
  58 
  59       - name: Determine versions and locations to be used for dependencies
  60         id: check_deps
  61         run: "echo ::set-output name=dependencies::`cat make/conf/version-numbers.conf make/conf/test-dependencies | sed -e '1i {' -e 's/#.*//g' -e 's/\"//g' -e 's/\\(.*\\)=\\(.*\\)/\"\\1\": \"\\2\",/g' -e '$s/,\\s\\{0,\\}$/\\}/'`"
  62         working-directory: jdk
  63         if: steps.check_submit.outputs.should_run != 'false'
  64 
  65       - name: Print extracted dependencies to the log
  66         run: "echo '${{ steps.check_deps.outputs.dependencies }}'"
  67         if: steps.check_submit.outputs.should_run != 'false'
  68 
  69       - name: Determine the jtreg ref to checkout
  70         run: "echo JTREG_REF=jtreg-${{ fromJson(steps.check_deps.outputs.dependencies).JTREG_VERSION }}+${{ fromJson(steps.check_deps.outputs.dependencies).JTREG_BUILD }} >> $GITHUB_ENV"
  71         if: steps.check_submit.outputs.should_run != 'false'
  72 
  73       - name: Check if a jtreg image is present in the cache
  74         id: jtreg
  75         uses: actions/cache@v2
  76         with:
  77           path: ~/jtreg/
  78           key: jtreg-${{ env.JTREG_REF }}-v1
  79         if: steps.check_submit.outputs.should_run != 'false'
  80 
  81       - name: Checkout the jtreg source
  82         uses: actions/checkout@v2
  83         with:
  84           repository: "openjdk/jtreg"
  85           ref: ${{ env.JTREG_REF }}
  86           path: jtreg
  87         if: steps.check_submit.outputs.should_run != 'false' && steps.jtreg.outputs.cache-hit != 'true'
  88 
  89       - name: Build jtreg
  90         run: bash make/build.sh --jdk ${JAVA_HOME_8_X64}
  91         working-directory: jtreg
  92         if: steps.check_submit.outputs.should_run != 'false' && steps.jtreg.outputs.cache-hit != 'true'
  93 
  94       - name: Move jtreg image to destination folder
  95         run: mv build/images/jtreg ~/
  96         working-directory: jtreg
  97         if: steps.check_submit.outputs.should_run != 'false' && steps.jtreg.outputs.cache-hit != 'true'
  98 
  99       - name: Store jtreg for use by later steps
 100         uses: actions/upload-artifact@v2
 101         with:
 102           name: transient_jtreg_${{ steps.check_bundle_id.outputs.bundle_id }}
 103           path: ~/jtreg/
 104         if: steps.check_submit.outputs.should_run != 'false'
 105 
 106   linux_x64_build:
 107     name: Linux x64
 108     runs-on: "ubuntu-20.04"
 109     needs: prerequisites
 110     if: needs.prerequisites.outputs.should_run != 'false' && (needs.prerequisites.outputs.platform_linux_x64 != 'false' || needs.prerequisites.outputs.platform_linux_additional == 'true')
 111 
 112     strategy:
 113       fail-fast: false
 114       matrix:
 115         flavor:
 116           - build release
 117           - build debug
 118         include:
 119           - flavor: build debug
 120             flags: --enable-debug
 121             artifact: -debug
 122 
 123     env:
 124       JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_FEATURE }}"
 125       BOOT_JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).BOOT_JDK_VERSION }}"
 126       BOOT_JDK_FILENAME: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_FILENAME }}"
 127       BOOT_JDK_URL: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_URL }}"
 128       BOOT_JDK_SHA256: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_SHA256 }}"
 129 
 130     steps:
 131       - name: Checkout the source
 132         uses: actions/checkout@v2
 133         with:
 134           path: jdk
 135 
 136       - name: Restore boot JDK from cache
 137         id: bootjdk
 138         uses: actions/cache@v2
 139         with:
 140           path: ~/bootjdk/${{ env.BOOT_JDK_VERSION }}
 141           key: bootjdk-${{ runner.os }}-${{ env.BOOT_JDK_VERSION }}-${{ env.BOOT_JDK_SHA256 }}-v1
 142 
 143       - name: Download boot JDK
 144         run: |
 145           mkdir -p "${HOME}/bootjdk/${BOOT_JDK_VERSION}"
 146           wget -O "${HOME}/bootjdk/${BOOT_JDK_FILENAME}" "${BOOT_JDK_URL}"
 147           echo "${BOOT_JDK_SHA256} ${HOME}/bootjdk/${BOOT_JDK_FILENAME}" | sha256sum -c >/dev/null -
 148           tar -xf "${HOME}/bootjdk/${BOOT_JDK_FILENAME}" -C "${HOME}/bootjdk/${BOOT_JDK_VERSION}"
 149           mv "${HOME}/bootjdk/${BOOT_JDK_VERSION}/"*/* "${HOME}/bootjdk/${BOOT_JDK_VERSION}/"
 150         if: steps.bootjdk.outputs.cache-hit != 'true'
 151 
 152       - name: Restore jtreg artifact
 153         id: jtreg_restore
 154         uses: actions/download-artifact@v2
 155         with:
 156           name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }}
 157           path: ~/jtreg/
 158         continue-on-error: true
 159 
 160       - name: Restore jtreg artifact (retry)
 161         uses: actions/download-artifact@v2
 162         with:
 163           name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }}
 164           path: ~/jtreg/
 165         if: steps.jtreg_restore.outcome == 'failure'
 166 
 167       - name: Checkout gtest sources
 168         uses: actions/checkout@v2
 169         with:
 170           repository: "google/googletest"
 171           ref: "release-${{ fromJson(needs.prerequisites.outputs.dependencies).GTEST_VERSION }}"
 172           path: gtest
 173 
 174       - name: Install dependencies
 175         run: |
 176           sudo apt-get update
 177           sudo apt-get install gcc-10=10.3.0-1ubuntu1~20.04 g++-10=10.3.0-1ubuntu1~20.04 libxrandr-dev libxtst-dev libcups2-dev libasound2-dev
 178           sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10
 179 
 180       - name: Configure
 181         run: >
 182           bash configure
 183           --with-conf-name=linux-x64
 184           ${{ matrix.flags }}
 185           --with-version-opt=${GITHUB_ACTOR}-${GITHUB_SHA}
 186           --with-version-build=0
 187           --with-boot-jdk=${HOME}/bootjdk/${BOOT_JDK_VERSION}
 188           --with-jtreg=${HOME}/jtreg
 189           --with-gtest=${GITHUB_WORKSPACE}/gtest
 190           --with-default-make-target="product-bundles test-bundles"
 191           --with-zlib=system
 192           --enable-jtreg-failure-handler
 193         working-directory: jdk
 194 
 195       - name: Build
 196         run: make CONF_NAME=linux-x64
 197         working-directory: jdk
 198 
 199       - name: Persist test bundles
 200         uses: actions/upload-artifact@v2
 201         with:
 202           name: transient_jdk-linux-x64${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }}
 203           path: |
 204             jdk/build/linux-x64/bundles/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x64_bin${{ matrix.artifact }}.tar.gz
 205             jdk/build/linux-x64/bundles/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x64_bin-tests${{ matrix.artifact }}.tar.gz
 206 
 207   linux_x64_test:
 208     name: Linux x64
 209     runs-on: "ubuntu-20.04"
 210     needs:
 211       - prerequisites
 212       - linux_x64_build
 213 
 214     strategy:
 215       fail-fast: false
 216       matrix:
 217         test:
 218           - jdk/tier1 part 1
 219           - jdk/tier1 part 2
 220           - jdk/tier1 part 3
 221           - langtools/tier1
 222           - hs/tier1 common
 223           - hs/tier1 compiler
 224           - hs/tier1 gc
 225           - hs/tier1 runtime
 226           - hs/tier1 serviceability
 227         include:
 228           - test: jdk/tier1 part 1
 229             suites: test/jdk/:tier1_part1
 230           - test: jdk/tier1 part 2
 231             suites: test/jdk/:tier1_part2
 232           - test: jdk/tier1 part 3
 233             suites: test/jdk/:tier1_part3
 234           - test: langtools/tier1
 235             suites: test/langtools/:tier1
 236           - test: hs/tier1 common
 237             suites: test/hotspot/jtreg/:tier1_common
 238             artifact: -debug
 239           - test: hs/tier1 compiler
 240             suites: test/hotspot/jtreg/:tier1_compiler
 241             artifact: -debug
 242           - test: hs/tier1 gc
 243             suites: test/hotspot/jtreg/:tier1_gc
 244             artifact: -debug
 245           - test: hs/tier1 runtime
 246             suites: test/hotspot/jtreg/:tier1_runtime
 247             artifact: -debug
 248           - test: hs/tier1 serviceability
 249             suites: test/hotspot/jtreg/:tier1_serviceability
 250             artifact: -debug
 251 
 252     env:
 253       JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_FEATURE }}"
 254       BOOT_JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).BOOT_JDK_VERSION }}"
 255       BOOT_JDK_FILENAME: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_FILENAME }}"
 256       BOOT_JDK_URL: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_URL }}"
 257       BOOT_JDK_SHA256: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_SHA256 }}"
 258 
 259     steps:
 260       - name: Checkout the source
 261         uses: actions/checkout@v2
 262 
 263       - name: Restore boot JDK from cache
 264         id: bootjdk
 265         uses: actions/cache@v2
 266         with:
 267           path: ~/bootjdk/${{ env.BOOT_JDK_VERSION }}
 268           key: bootjdk-${{ runner.os }}-${{ env.BOOT_JDK_VERSION }}-${{ env.BOOT_JDK_SHA256 }}-v1
 269 
 270       - name: Download boot JDK
 271         run: |
 272           mkdir -p "${HOME}/bootjdk/${BOOT_JDK_VERSION}"
 273           wget -O "${HOME}/bootjdk/${BOOT_JDK_FILENAME}" "${BOOT_JDK_URL}"
 274           echo "${BOOT_JDK_SHA256} ${HOME}/bootjdk/${BOOT_JDK_FILENAME}" | sha256sum -c >/dev/null -
 275           tar -xf "${HOME}/bootjdk/${BOOT_JDK_FILENAME}" -C "${HOME}/bootjdk/${BOOT_JDK_VERSION}"
 276           mv "${HOME}/bootjdk/${BOOT_JDK_VERSION}/"*/* "${HOME}/bootjdk/${BOOT_JDK_VERSION}/"
 277         if: steps.bootjdk.outputs.cache-hit != 'true'
 278 
 279       - name: Restore jtreg artifact
 280         id: jtreg_restore
 281         uses: actions/download-artifact@v2
 282         with:
 283           name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }}
 284           path: ~/jtreg/
 285         continue-on-error: true
 286 
 287       - name: Restore jtreg artifact (retry)
 288         uses: actions/download-artifact@v2
 289         with:
 290           name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }}
 291           path: ~/jtreg/
 292         if: steps.jtreg_restore.outcome == 'failure'
 293 
 294       - name: Restore build artifacts
 295         id: build_restore
 296         uses: actions/download-artifact@v2
 297         with:
 298           name: transient_jdk-linux-x64${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }}
 299           path: ~/jdk-linux-x64${{ matrix.artifact }}
 300         continue-on-error: true
 301 
 302       - name: Restore build artifacts (retry)
 303         uses: actions/download-artifact@v2
 304         with:
 305           name: transient_jdk-linux-x64${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }}
 306           path: ~/jdk-linux-x64${{ matrix.artifact }}
 307         if: steps.build_restore.outcome == 'failure'
 308 
 309       - name: Unpack jdk
 310         run: |
 311           mkdir -p "${HOME}/jdk-linux-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x64_bin${{ matrix.artifact }}"
 312           tar -xf "${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 }}"
 313 
 314       - name: Unpack tests
 315         run: |
 316           mkdir -p "${HOME}/jdk-linux-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x64_bin-tests${{ matrix.artifact }}"
 317           tar -xf "${HOME}/jdk-linux-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x64_bin-tests${{ matrix.artifact }}.tar.gz" -C "${HOME}/jdk-linux-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x64_bin-tests${{ matrix.artifact }}"
 318 
 319       - name: Find root of jdk image dir
 320         run: |
 321           imageroot=`find ${HOME}/jdk-linux-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x64_bin${{ matrix.artifact }} -name release -type f`
 322           echo "imageroot=`dirname ${imageroot}`" >> $GITHUB_ENV
 323 
 324       - name: Run tests
 325         run: >
 326           JDK_IMAGE_DIR=${{ env.imageroot }}
 327           TEST_IMAGE_DIR=${HOME}/jdk-linux-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x64_bin-tests${{ matrix.artifact }}
 328           BOOT_JDK=${HOME}/bootjdk/${BOOT_JDK_VERSION}
 329           JT_HOME=${HOME}/jtreg
 330           make test-prebuilt
 331           CONF_NAME=run-test-prebuilt
 332           LOG_CMDLINES=true
 333           JTREG_VERBOSE=fail,error,time
 334           TEST="${{ matrix.suites }}"
 335           TEST_OPTS_JAVA_OPTIONS=
 336           JTREG_KEYWORDS="!headful"
 337           JTREG="JAVA_OPTIONS=-XX:-CreateCoredumpOnCrash"
 338 
 339       - name: Check that all tests executed successfully
 340         if: always()
 341         run: >
 342           if ! grep --include=test-summary.txt -lqr build/*/test-results -e "TEST SUCCESS" ; then
 343             cat build/*/test-results/*/text/newfailures.txt ;
 344             exit 1 ;
 345           fi
 346 
 347       - name: Create suitable test log artifact name
 348         if: always()
 349         run: echo "logsuffix=`echo ${{ matrix.test }} | sed -e 's!/!_!'g -e 's! !_!'g`" >> $GITHUB_ENV
 350 
 351       - name: Package test results
 352         if: always()
 353         working-directory: build/run-test-prebuilt/test-results/
 354         run: >
 355           zip -r9
 356           "$HOME/linux-x64${{ matrix.artifact }}_testresults_${{ env.logsuffix }}.zip"
 357           .
 358         continue-on-error: true
 359 
 360       - name: Package test support
 361         if: always()
 362         working-directory: build/run-test-prebuilt/test-support/
 363         run: >
 364           zip -r9
 365           "$HOME/linux-x64${{ matrix.artifact }}_testsupport_${{ env.logsuffix }}.zip"
 366           .
 367           -i *.jtr
 368           -i */hs_err*.log
 369           -i */replay*.log
 370         continue-on-error: true
 371 
 372       - name: Persist test results
 373         if: always()
 374         uses: actions/upload-artifact@v2
 375         with:
 376           path: ~/linux-x64${{ matrix.artifact }}_testresults_${{ env.logsuffix }}.zip
 377         continue-on-error: true
 378 
 379       - name: Persist test outputs
 380         if: always()
 381         uses: actions/upload-artifact@v2
 382         with:
 383           path: ~/linux-x64${{ matrix.artifact }}_testsupport_${{ env.logsuffix }}.zip
 384         continue-on-error: true
 385 
 386   linux_additional_build:
 387     name: Linux additional
 388     runs-on: "ubuntu-20.04"
 389     needs:
 390       - prerequisites
 391       - linux_x64_build
 392     if: needs.prerequisites.outputs.should_run != 'false' && needs.prerequisites.outputs.platform_linux_additional != 'false'
 393 
 394     strategy:
 395       fail-fast: false
 396       matrix:
 397         flavor:
 398           - hs x64 build only
 399           - hs x64 zero build only
 400           - hs x64 minimal build only
 401           - hs x64 optimized build only
 402           - hs aarch64 build only
 403           - hs arm build only
 404           - hs s390x build only
 405           - hs ppc64le build only
 406         include:
 407           - flavor: hs x64 build only
 408             flags: --enable-debug --disable-precompiled-headers
 409           - flavor: hs x64 zero build only
 410             flags: --enable-debug --disable-precompiled-headers --with-jvm-variants=zero
 411           - flavor: hs x64 minimal build only
 412             flags: --enable-debug --disable-precompiled-headers --with-jvm-variants=minimal
 413           - flavor: hs x64 optimized build only
 414             flags: --with-debug-level=optimized --disable-precompiled-headers
 415           - flavor: hs aarch64 build only
 416             flags: --enable-debug --disable-precompiled-headers
 417             debian-arch: arm64
 418             gnu-arch: aarch64
 419           - flavor: hs arm build only
 420             flags: --enable-debug --disable-precompiled-headers
 421             debian-arch: armhf
 422             gnu-arch: arm
 423             gnu-flavor: eabihf
 424           - flavor: hs s390x build only
 425             flags: --enable-debug --disable-precompiled-headers
 426             debian-arch: s390x
 427             gnu-arch: s390x
 428           - flavor: hs ppc64le build only
 429             flags: --enable-debug --disable-precompiled-headers
 430             debian-arch: ppc64el
 431             gnu-arch: powerpc64le
 432 
 433     env:
 434       JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_FEATURE }}"
 435       BOOT_JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).BOOT_JDK_VERSION }}"
 436       BOOT_JDK_FILENAME: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_FILENAME }}"
 437       BOOT_JDK_URL: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_URL }}"
 438       BOOT_JDK_SHA256: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_SHA256 }}"
 439 
 440     steps:
 441       - name: Checkout the source
 442         uses: actions/checkout@v2
 443         with:
 444           path: jdk
 445 
 446       - name: Restore boot JDK from cache
 447         id: bootjdk
 448         uses: actions/cache@v2
 449         with:
 450           path: ~/bootjdk/${{ env.BOOT_JDK_VERSION }}
 451           key: bootjdk-${{ runner.os }}-${{ env.BOOT_JDK_VERSION }}-${{ env.BOOT_JDK_SHA256 }}-v1
 452 
 453       - name: Download boot JDK
 454         run: |
 455           mkdir -p "${HOME}/bootjdk/${BOOT_JDK_VERSION}"
 456           wget -O "${HOME}/bootjdk/${BOOT_JDK_FILENAME}" "${BOOT_JDK_URL}"
 457           echo "${BOOT_JDK_SHA256} ${HOME}/bootjdk/${BOOT_JDK_FILENAME}" | sha256sum -c >/dev/null -
 458           tar -xf "${HOME}/bootjdk/${BOOT_JDK_FILENAME}" -C "${HOME}/bootjdk/${BOOT_JDK_VERSION}"
 459           mv "${HOME}/bootjdk/${BOOT_JDK_VERSION}/"*/* "${HOME}/bootjdk/${BOOT_JDK_VERSION}/"
 460         if: steps.bootjdk.outputs.cache-hit != 'true'
 461 
 462       - name: Restore build JDK
 463         id: build_restore
 464         uses: actions/download-artifact@v2
 465         with:
 466           name: transient_jdk-linux-x64_${{ needs.prerequisites.outputs.bundle_id }}
 467           path: ~/jdk-linux-x64
 468         continue-on-error: true
 469 
 470       - name: Restore build JDK (retry)
 471         uses: actions/download-artifact@v2
 472         with:
 473           name: transient_jdk-linux-x64_${{ needs.prerequisites.outputs.bundle_id }}
 474           path: ~/jdk-linux-x64
 475         if: steps.build_restore.outcome == 'failure'
 476 
 477       - name: Unpack build JDK
 478         run: |
 479           mkdir -p "${HOME}/jdk-linux-x64/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x64_bin"
 480           tar -xf "${HOME}/jdk-linux-x64/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x64_bin.tar.gz" -C "${HOME}/jdk-linux-x64/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x64_bin"
 481 
 482       - name: Find root of build JDK image dir
 483         run: |
 484           build_jdk_root=`find ${HOME}/jdk-linux-x64/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x64_bin -name release -type f`
 485           echo "build_jdk_root=`dirname ${build_jdk_root}`" >> $GITHUB_ENV
 486 
 487       - name: Update apt
 488         run: sudo apt-get update
 489 
 490       - name: Install native host dependencies
 491         run: |
 492           sudo apt-get install gcc-10=10.3.0-1ubuntu1~20.04 g++-10=10.3.0-1ubuntu1~20.04 libxrandr-dev libxtst-dev libcups2-dev libasound2-dev
 493           sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10
 494         if: matrix.debian-arch == ''
 495 
 496       - name: Install cross-compilation host dependencies
 497         run: sudo apt-get install gcc-10-${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-flavor}}=10.3.0-1ubuntu1~20.04cross1 g++-10-${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-flavor}}=10.3.0-1ubuntu1~20.04cross1
 498         if: matrix.debian-arch != ''
 499 
 500       - name: Cache sysroot
 501         id: cache-sysroot
 502         uses: actions/cache@v2
 503         with:
 504           path: ~/sysroot-${{ matrix.debian-arch }}/
 505           key: sysroot-${{ matrix.debian-arch }}-${{ hashFiles('jdk/.github/workflows/submit.yml') }}
 506         if: matrix.debian-arch != ''
 507 
 508       - name: Install sysroot host dependencies
 509         run: sudo apt-get install debootstrap qemu-user-static
 510         if: matrix.debian-arch != '' && steps.cache-sysroot.outputs.cache-hit != 'true'
 511 
 512       - name: Create sysroot
 513         run: >
 514           sudo qemu-debootstrap
 515           --arch=${{ matrix.debian-arch }}
 516           --verbose
 517           --include=fakeroot,symlinks,build-essential,libx11-dev,libxext-dev,libxrender-dev,libxrandr-dev,libxtst-dev,libxt-dev,libcups2-dev,libfontconfig1-dev,libasound2-dev,libfreetype6-dev,libpng-dev
 518           --resolve-deps
 519           buster
 520           ~/sysroot-${{ matrix.debian-arch }}
 521           http://httpredir.debian.org/debian/
 522         if: matrix.debian-arch != '' && steps.cache-sysroot.outputs.cache-hit != 'true'
 523 
 524       - name: Prepare sysroot for caching
 525         run: |
 526           sudo chroot ~/sysroot-${{ matrix.debian-arch }} symlinks -cr .
 527           sudo chown ${USER} -R ~/sysroot-${{ matrix.debian-arch }}
 528           rm -rf ~/sysroot-${{ matrix.debian-arch }}/{dev,proc,run,sys}
 529         if: matrix.debian-arch != '' && steps.cache-sysroot.outputs.cache-hit != 'true'
 530 
 531       - name: Configure cross compiler
 532         run: |
 533           echo "CC=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-flavor}}-gcc-10" >> $GITHUB_ENV
 534           echo "CXX=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-flavor}}-g++-10" >> $GITHUB_ENV
 535         if: matrix.debian-arch != ''
 536 
 537       - name: Configure cross specific flags
 538         run: >
 539           echo "cross_flags=
 540           --openjdk-target=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-flavor}}
 541           --with-sysroot=${HOME}/sysroot-${{ matrix.debian-arch }}/
 542           " >> $GITHUB_ENV
 543         if: matrix.debian-arch != ''
 544 
 545       - name: Configure
 546         run: >
 547           bash configure
 548           --with-conf-name=linux-${{ matrix.gnu-arch }}-hotspot
 549           ${{ matrix.flags }}
 550           ${{ env.cross_flags }}
 551           --with-version-opt=${GITHUB_ACTOR}-${GITHUB_SHA}
 552           --with-version-build=0
 553           --with-boot-jdk=${HOME}/bootjdk/${BOOT_JDK_VERSION}
 554           --with-build-jdk=${{ env.build_jdk_root }}
 555           --with-default-make-target="hotspot"
 556           --with-zlib=system
 557         working-directory: jdk
 558 
 559       - name: Build
 560         run: make CONF_NAME=linux-${{ matrix.gnu-arch }}-hotspot
 561         working-directory: jdk
 562 
 563   linux_x86_build:
 564     name: Linux x86
 565     runs-on: "ubuntu-20.04"
 566     needs: prerequisites
 567     if: needs.prerequisites.outputs.should_run != 'false' && needs.prerequisites.outputs.platform_linux_x86 != 'false'
 568 
 569     strategy:
 570       fail-fast: false
 571       matrix:
 572         flavor:
 573           - build release
 574           - build debug
 575         include:
 576           - flavor: build debug
 577             flags: --enable-debug
 578             artifact: -debug
 579 
 580     # Reduced 32-bit build uses the same boot JDK as 64-bit build
 581     env:
 582       JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_FEATURE }}"
 583       BOOT_JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).BOOT_JDK_VERSION }}"
 584       BOOT_JDK_FILENAME: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_FILENAME }}"
 585       BOOT_JDK_URL: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_URL }}"
 586       BOOT_JDK_SHA256: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_SHA256 }}"
 587 
 588     steps:
 589       - name: Checkout the source
 590         uses: actions/checkout@v2
 591         with:
 592           path: jdk
 593 
 594       - name: Restore boot JDK from cache
 595         id: bootjdk
 596         uses: actions/cache@v2
 597         with:
 598           path: ~/bootjdk/${{ env.BOOT_JDK_VERSION }}
 599           key: bootjdk-${{ runner.os }}-${{ env.BOOT_JDK_VERSION }}-${{ env.BOOT_JDK_SHA256 }}-v1
 600 
 601       - name: Download boot JDK
 602         run: |
 603           mkdir -p "${HOME}/bootjdk/${BOOT_JDK_VERSION}"
 604           wget -O "${HOME}/bootjdk/${BOOT_JDK_FILENAME}" "${BOOT_JDK_URL}"
 605           echo "${BOOT_JDK_SHA256} ${HOME}/bootjdk/${BOOT_JDK_FILENAME}" | sha256sum -c >/dev/null -
 606           tar -xf "${HOME}/bootjdk/${BOOT_JDK_FILENAME}" -C "${HOME}/bootjdk/${BOOT_JDK_VERSION}"
 607           mv "${HOME}/bootjdk/${BOOT_JDK_VERSION}/"*/* "${HOME}/bootjdk/${BOOT_JDK_VERSION}/"
 608         if: steps.bootjdk.outputs.cache-hit != 'true'
 609 
 610       - name: Restore jtreg artifact
 611         id: jtreg_restore
 612         uses: actions/download-artifact@v2
 613         with:
 614           name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }}
 615           path: ~/jtreg/
 616         continue-on-error: true
 617 
 618       - name: Restore jtreg artifact (retry)
 619         uses: actions/download-artifact@v2
 620         with:
 621           name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }}
 622           path: ~/jtreg/
 623         if: steps.jtreg_restore.outcome == 'failure'
 624 
 625       - name: Checkout gtest sources
 626         uses: actions/checkout@v2
 627         with:
 628           repository: "google/googletest"
 629           ref: "release-${{ fromJson(needs.prerequisites.outputs.dependencies).GTEST_VERSION }}"
 630           path: gtest
 631 
 632       # Roll in the multilib environment and its dependencies.
 633       # Some multilib libraries do not have proper inter-dependencies, so we have to
 634       # install their dependencies manually. Additionally, upgrading apt solves
 635       # the libc6 installation bugs until base image catches up, see JDK-8260460.
 636       - name: Install dependencies
 637         run: |
 638           sudo dpkg --add-architecture i386
 639           sudo apt-get update
 640           sudo apt-get install --only-upgrade apt
 641           sudo apt-get install gcc-10-multilib g++-10-multilib libfreetype6-dev:i386 libxrandr-dev:i386 libxtst-dev:i386 libtiff-dev:i386 libcupsimage2-dev:i386 libcups2-dev:i386 libasound2-dev:i386
 642           sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10
 643 
 644       - name: Configure
 645         run: >
 646           bash configure
 647           --with-conf-name=linux-x86
 648           --with-target-bits=32
 649           ${{ matrix.flags }}
 650           --with-version-opt=${GITHUB_ACTOR}-${GITHUB_SHA}
 651           --with-version-build=0
 652           --with-boot-jdk=${HOME}/bootjdk/${BOOT_JDK_VERSION}
 653           --with-jtreg=${HOME}/jtreg
 654           --with-gtest=${GITHUB_WORKSPACE}/gtest
 655           --with-default-make-target="product-bundles test-bundles"
 656           --with-zlib=system
 657           --enable-jtreg-failure-handler
 658         working-directory: jdk
 659 
 660       - name: Build
 661         run: make CONF_NAME=linux-x86
 662         working-directory: jdk
 663 
 664       - name: Persist test bundles
 665         uses: actions/upload-artifact@v2
 666         with:
 667           name: transient_jdk-linux-x86${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }}
 668           path: |
 669             jdk/build/linux-x86/bundles/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x86_bin${{ matrix.artifact }}.tar.gz
 670             jdk/build/linux-x86/bundles/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x86_bin-tests${{ matrix.artifact }}.tar.gz
 671 
 672   linux_x86_test:
 673     name: Linux x86
 674     runs-on: "ubuntu-20.04"
 675     needs:
 676       - prerequisites
 677       - linux_x86_build
 678 
 679     strategy:
 680       fail-fast: false
 681       matrix:
 682         test:
 683           - jdk/tier1 part 1
 684           - jdk/tier1 part 2
 685           - jdk/tier1 part 3
 686           - langtools/tier1
 687           - hs/tier1 common
 688           - hs/tier1 compiler
 689           - hs/tier1 gc
 690           - hs/tier1 runtime
 691           - hs/tier1 serviceability
 692         include:
 693           - test: jdk/tier1 part 1
 694             suites: test/jdk/:tier1_part1
 695           - test: jdk/tier1 part 2
 696             suites: test/jdk/:tier1_part2
 697           - test: jdk/tier1 part 3
 698             suites: test/jdk/:tier1_part3
 699           - test: langtools/tier1
 700             suites: test/langtools/:tier1
 701           - test: hs/tier1 common
 702             suites: test/hotspot/jtreg/:tier1_common
 703             artifact: -debug
 704           - test: hs/tier1 compiler
 705             suites: test/hotspot/jtreg/:tier1_compiler
 706             artifact: -debug
 707           - test: hs/tier1 gc
 708             suites: test/hotspot/jtreg/:tier1_gc
 709             artifact: -debug
 710           - test: hs/tier1 runtime
 711             suites: test/hotspot/jtreg/:tier1_runtime
 712             artifact: -debug
 713           - test: hs/tier1 serviceability
 714             suites: test/hotspot/jtreg/:tier1_serviceability
 715             artifact: -debug
 716 
 717     # Reduced 32-bit build uses the same boot JDK as 64-bit build
 718     env:
 719       JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_FEATURE }}"
 720       BOOT_JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).BOOT_JDK_VERSION }}"
 721       BOOT_JDK_FILENAME: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_FILENAME }}"
 722       BOOT_JDK_URL: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_URL }}"
 723       BOOT_JDK_SHA256: "${{ fromJson(needs.prerequisites.outputs.dependencies).LINUX_X64_BOOT_JDK_SHA256 }}"
 724 
 725     steps:
 726       - name: Checkout the source
 727         uses: actions/checkout@v2
 728 
 729       - name: Restore boot JDK from cache
 730         id: bootjdk
 731         uses: actions/cache@v2
 732         with:
 733           path: ~/bootjdk/${{ env.BOOT_JDK_VERSION }}
 734           key: bootjdk-${{ runner.os }}-${{ env.BOOT_JDK_VERSION }}-${{ env.BOOT_JDK_SHA256 }}-v1
 735 
 736       - name: Download boot JDK
 737         run: |
 738           mkdir -p "${HOME}/bootjdk/${BOOT_JDK_VERSION}"
 739           wget -O "${HOME}/bootjdk/${BOOT_JDK_FILENAME}" "${BOOT_JDK_URL}"
 740           echo "${BOOT_JDK_SHA256} ${HOME}/bootjdk/${BOOT_JDK_FILENAME}" | sha256sum -c >/dev/null -
 741           tar -xf "${HOME}/bootjdk/${BOOT_JDK_FILENAME}" -C "${HOME}/bootjdk/${BOOT_JDK_VERSION}"
 742           mv "${HOME}/bootjdk/${BOOT_JDK_VERSION}/"*/* "${HOME}/bootjdk/${BOOT_JDK_VERSION}/"
 743         if: steps.bootjdk.outputs.cache-hit != 'true'
 744 
 745       - name: Restore jtreg artifact
 746         id: jtreg_restore
 747         uses: actions/download-artifact@v2
 748         with:
 749           name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }}
 750           path: ~/jtreg/
 751         continue-on-error: true
 752 
 753       - name: Restore jtreg artifact (retry)
 754         uses: actions/download-artifact@v2
 755         with:
 756           name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }}
 757           path: ~/jtreg/
 758         if: steps.jtreg_restore.outcome == 'failure'
 759 
 760       - name: Restore build artifacts
 761         id: build_restore
 762         uses: actions/download-artifact@v2
 763         with:
 764           name: transient_jdk-linux-x86${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }}
 765           path: ~/jdk-linux-x86${{ matrix.artifact }}
 766         continue-on-error: true
 767 
 768       - name: Restore build artifacts (retry)
 769         uses: actions/download-artifact@v2
 770         with:
 771           name: transient_jdk-linux-x86${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }}
 772           path: ~/jdk-linux-x86${{ matrix.artifact }}
 773         if: steps.build_restore.outcome == 'failure'
 774 
 775       - name: Unpack jdk
 776         run: |
 777           mkdir -p "${HOME}/jdk-linux-x86${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x86_bin${{ matrix.artifact }}"
 778           tar -xf "${HOME}/jdk-linux-x86${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x86_bin${{ matrix.artifact }}.tar.gz" -C "${HOME}/jdk-linux-x86${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x86_bin${{ matrix.artifact }}"
 779 
 780       - name: Unpack tests
 781         run: |
 782           mkdir -p "${HOME}/jdk-linux-x86${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x86_bin-tests${{ matrix.artifact }}"
 783           tar -xf "${HOME}/jdk-linux-x86${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x86_bin-tests${{ matrix.artifact }}.tar.gz" -C "${HOME}/jdk-linux-x86${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x86_bin-tests${{ matrix.artifact }}"
 784 
 785       - name: Find root of jdk image dir
 786         run: |
 787           imageroot=`find ${HOME}/jdk-linux-x86${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x86_bin${{ matrix.artifact }} -name release -type f`
 788           echo "imageroot=`dirname ${imageroot}`" >> $GITHUB_ENV
 789 
 790       - name: Run tests
 791         run: >
 792           JDK_IMAGE_DIR=${{ env.imageroot }}
 793           TEST_IMAGE_DIR=${HOME}/jdk-linux-x86${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_linux-x86_bin-tests${{ matrix.artifact }}
 794           BOOT_JDK=${HOME}/bootjdk/${BOOT_JDK_VERSION}
 795           JT_HOME=${HOME}/jtreg
 796           make test-prebuilt
 797           CONF_NAME=run-test-prebuilt
 798           LOG_CMDLINES=true
 799           JTREG_VERBOSE=fail,error,time
 800           TEST="${{ matrix.suites }}"
 801           TEST_OPTS_JAVA_OPTIONS=
 802           JTREG_KEYWORDS="!headful"
 803           JTREG="JAVA_OPTIONS=-XX:-CreateCoredumpOnCrash"
 804 
 805       - name: Check that all tests executed successfully
 806         if: always()
 807         run: >
 808           if ! grep --include=test-summary.txt -lqr build/*/test-results -e "TEST SUCCESS" ; then
 809             cat build/*/test-results/*/text/newfailures.txt ;
 810             exit 1 ;
 811           fi
 812 
 813       - name: Create suitable test log artifact name
 814         if: always()
 815         run: echo "logsuffix=`echo ${{ matrix.test }} | sed -e 's!/!_!'g -e 's! !_!'g`" >> $GITHUB_ENV
 816 
 817       - name: Package test results
 818         if: always()
 819         working-directory: build/run-test-prebuilt/test-results/
 820         run: >
 821           zip -r9
 822           "$HOME/linux-x86${{ matrix.artifact }}_testresults_${{ env.logsuffix }}.zip"
 823           .
 824         continue-on-error: true
 825 
 826       - name: Package test support
 827         if: always()
 828         working-directory: build/run-test-prebuilt/test-support/
 829         run: >
 830           zip -r9
 831           "$HOME/linux-x86${{ matrix.artifact }}_testsupport_${{ env.logsuffix }}.zip"
 832           .
 833           -i *.jtr
 834           -i */hs_err*.log
 835           -i */replay*.log
 836         continue-on-error: true
 837 
 838       - name: Persist test results
 839         if: always()
 840         uses: actions/upload-artifact@v2
 841         with:
 842           path: ~/linux-x86${{ matrix.artifact }}_testresults_${{ env.logsuffix }}.zip
 843         continue-on-error: true
 844 
 845       - name: Persist test outputs
 846         if: always()
 847         uses: actions/upload-artifact@v2
 848         with:
 849           path: ~/linux-x86${{ matrix.artifact }}_testsupport_${{ env.logsuffix }}.zip
 850         continue-on-error: true
 851 
 852   windows_aarch64_build:
 853     name: Windows aarch64
 854     runs-on: "windows-2019"
 855     needs: prerequisites
 856     if: needs.prerequisites.outputs.should_run != 'false' && needs.prerequisites.outputs.platform_windows_aarch64 != 'false'
 857 
 858     strategy:
 859       fail-fast: false
 860       matrix:
 861         flavor:
 862           - build debug
 863         include:
 864           - flavor: build debug
 865             flags: --enable-debug
 866             artifact: -debug
 867 
 868     env:
 869       JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_FEATURE }}"
 870       BOOT_JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).BOOT_JDK_VERSION }}"
 871       BOOT_JDK_FILENAME: "${{ fromJson(needs.prerequisites.outputs.dependencies).WINDOWS_X64_BOOT_JDK_FILENAME }}"
 872       BOOT_JDK_URL: "${{ fromJson(needs.prerequisites.outputs.dependencies).WINDOWS_X64_BOOT_JDK_URL }}"
 873       BOOT_JDK_SHA256: "${{ fromJson(needs.prerequisites.outputs.dependencies).WINDOWS_X64_BOOT_JDK_SHA256 }}"
 874 
 875     steps:
 876       - name: Restore cygwin packages from cache
 877         id: cygwin
 878         uses: actions/cache@v2
 879         with:
 880           path: ~/cygwin/packages
 881           key: cygwin-packages-${{ runner.os }}-v1
 882 
 883       - name: Install cygwin
 884         run: |
 885           New-Item -Force -ItemType directory -Path "$HOME\cygwin"
 886           & curl -L "https://www.cygwin.com/setup-x86_64.exe" -o "$HOME/cygwin/setup-x86_64.exe"
 887           Start-Process -FilePath "$HOME\cygwin\setup-x86_64.exe" -ArgumentList "--quiet-mode --packages autoconf,make,zip,unzip --root $HOME\cygwin\cygwin64 --local-package-dir $HOME\cygwin\packages --site http://mirrors.kernel.org/sourceware/cygwin --no-desktop --no-shortcuts --no-startmenu --no-admin" -Wait -NoNewWindow
 888 
 889       - name: Checkout the source
 890         uses: actions/checkout@v2
 891         with:
 892           path: jdk
 893 
 894       - name: Restore boot JDK from cache
 895         id: bootjdk
 896         uses: actions/cache@v2
 897         with:
 898           path: ~/bootjdk/${{ env.BOOT_JDK_VERSION }}
 899           key: bootjdk-${{ runner.os }}-${{ env.BOOT_JDK_VERSION }}-${{ env.BOOT_JDK_SHA256 }}-v1
 900 
 901       - name: Download boot JDK
 902         run: |
 903           mkdir -p "$HOME\bootjdk\$env:BOOT_JDK_VERSION"
 904           & curl -L "$env:BOOT_JDK_URL" -o "$HOME/bootjdk/$env:BOOT_JDK_FILENAME"
 905           $FileHash = Get-FileHash -Algorithm SHA256 "$HOME/bootjdk/$env:BOOT_JDK_FILENAME"
 906           $FileHash.Hash -eq $env:BOOT_JDK_SHA256
 907           & tar -xf "$HOME/bootjdk/$env:BOOT_JDK_FILENAME" -C "$HOME/bootjdk/$env:BOOT_JDK_VERSION"
 908           Get-ChildItem "$HOME\bootjdk\$env:BOOT_JDK_VERSION\*\*" | Move-Item -Destination "$HOME\bootjdk\$env:BOOT_JDK_VERSION"
 909         if: steps.bootjdk.outputs.cache-hit != 'true'
 910 
 911       - name: Ensure a specific version of MSVC is installed
 912         run: >
 913           Start-Process -FilePath 'C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe' -Wait -NoNewWindow -ArgumentList
 914           'modify --installPath "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise" --quiet
 915           --add Microsoft.VisualStudio.Component.VC.14.29.arm64'
 916 
 917       - name: Configure
 918         run: >
 919           $env:Path = "$HOME\cygwin\cygwin64\bin;$HOME\cygwin\cygwin64\bin;$env:Path" ;
 920           $env:Path = $env:Path -split ";" -match "C:\\Windows|PowerShell|cygwin" -join ";" ;
 921           $env:BOOT_JDK = cygpath "$HOME/bootjdk/$env:BOOT_JDK_VERSION" ;
 922           & bash configure
 923           --with-conf-name=windows-aarch64
 924           --with-msvc-toolset-version=14.29
 925           --openjdk-target=aarch64-unknown-cygwin
 926           ${{ matrix.flags }}
 927           --with-version-opt="$env:GITHUB_ACTOR-$env:GITHUB_SHA"
 928           --with-version-build=0
 929           --with-boot-jdk="$env:BOOT_JDK"
 930           --with-default-make-target="hotspot"
 931         working-directory: jdk
 932 
 933       - name: Build
 934         run: |
 935           $env:Path = "$HOME\cygwin\cygwin64\bin;$HOME\cygwin\cygwin64\bin;$env:Path" ;
 936           $env:Path = $env:Path -split ";" -match "C:\\Windows|PowerShell|cygwin" -join ";" ;
 937           & make CONF_NAME=windows-aarch64
 938         working-directory: jdk
 939 
 940   windows_x64_build:
 941     name: Windows x64
 942     runs-on: "windows-2019"
 943     needs: prerequisites
 944     if: needs.prerequisites.outputs.should_run != 'false' && needs.prerequisites.outputs.platform_windows_x64 != 'false'
 945 
 946     strategy:
 947       fail-fast: false
 948       matrix:
 949         flavor:
 950           - build release
 951           - build debug
 952         include:
 953           - flavor: build debug
 954             flags: --enable-debug
 955             artifact: -debug
 956 
 957     env:
 958       JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_FEATURE }}"
 959       BOOT_JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).BOOT_JDK_VERSION }}"
 960       BOOT_JDK_FILENAME: "${{ fromJson(needs.prerequisites.outputs.dependencies).WINDOWS_X64_BOOT_JDK_FILENAME }}"
 961       BOOT_JDK_URL: "${{ fromJson(needs.prerequisites.outputs.dependencies).WINDOWS_X64_BOOT_JDK_URL }}"
 962       BOOT_JDK_SHA256: "${{ fromJson(needs.prerequisites.outputs.dependencies).WINDOWS_X64_BOOT_JDK_SHA256 }}"
 963 
 964     steps:
 965       - name: Restore cygwin packages from cache
 966         id: cygwin
 967         uses: actions/cache@v2
 968         with:
 969           path: ~/cygwin/packages
 970           key: cygwin-packages-${{ runner.os }}-v1
 971 
 972       - name: Install cygwin
 973         run: |
 974           New-Item -Force -ItemType directory -Path "$HOME\cygwin"
 975           & curl -L "https://www.cygwin.com/setup-x86_64.exe" -o "$HOME/cygwin/setup-x86_64.exe"
 976           Start-Process -FilePath "$HOME\cygwin\setup-x86_64.exe" -ArgumentList "--quiet-mode --packages autoconf,make,zip,unzip --root $HOME\cygwin\cygwin64 --local-package-dir $HOME\cygwin\packages --site http://mirrors.kernel.org/sourceware/cygwin --no-desktop --no-shortcuts --no-startmenu --no-admin" -Wait -NoNewWindow
 977 
 978       - name: Checkout the source
 979         uses: actions/checkout@v2
 980         with:
 981           path: jdk
 982 
 983       - name: Restore boot JDK from cache
 984         id: bootjdk
 985         uses: actions/cache@v2
 986         with:
 987           path: ~/bootjdk/${{ env.BOOT_JDK_VERSION }}
 988           key: bootjdk-${{ runner.os }}-${{ env.BOOT_JDK_VERSION }}-${{ env.BOOT_JDK_SHA256 }}-v1
 989 
 990       - name: Download boot JDK
 991         run: |
 992           mkdir -p "$HOME\bootjdk\$env:BOOT_JDK_VERSION"
 993           & curl -L "$env:BOOT_JDK_URL" -o "$HOME/bootjdk/$env:BOOT_JDK_FILENAME"
 994           $FileHash = Get-FileHash -Algorithm SHA256 "$HOME/bootjdk/$env:BOOT_JDK_FILENAME"
 995           $FileHash.Hash -eq $env:BOOT_JDK_SHA256
 996           & tar -xf "$HOME/bootjdk/$env:BOOT_JDK_FILENAME" -C "$HOME/bootjdk/$env:BOOT_JDK_VERSION"
 997           Get-ChildItem "$HOME\bootjdk\$env:BOOT_JDK_VERSION\*\*" | Move-Item -Destination "$HOME\bootjdk\$env:BOOT_JDK_VERSION"
 998         if: steps.bootjdk.outputs.cache-hit != 'true'
 999 
1000       - name: Checkout gtest sources
1001         uses: actions/checkout@v2
1002         with:
1003           repository: "google/googletest"
1004           ref: "release-${{ fromJson(needs.prerequisites.outputs.dependencies).GTEST_VERSION }}"
1005           path: gtest
1006 
1007       - name: Restore jtreg artifact
1008         id: jtreg_restore
1009         uses: actions/download-artifact@v2
1010         with:
1011           name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }}
1012           path: ~/jtreg/
1013         continue-on-error: true
1014 
1015       - name: Restore jtreg artifact (retry)
1016         uses: actions/download-artifact@v2
1017         with:
1018           name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }}
1019           path: ~/jtreg/
1020         if: steps.jtreg_restore.outcome == 'failure'
1021 
1022       - name: Ensure a specific version of MSVC is installed
1023         run: >
1024           Start-Process -FilePath 'C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe' -Wait -NoNewWindow -ArgumentList
1025           'modify --installPath "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise" --quiet
1026           --add Microsoft.VisualStudio.Component.VC.14.28.x86.x64'
1027 
1028       - name: Configure
1029         run: >
1030           $env:Path = "$HOME\cygwin\cygwin64\bin;$HOME\cygwin\cygwin64\bin;$env:Path" ;
1031           $env:Path = $env:Path -split ";" -match "C:\\Windows|PowerShell|cygwin" -join ";" ;
1032           $env:BOOT_JDK = cygpath "$HOME/bootjdk/$env:BOOT_JDK_VERSION" ;
1033           $env:JT_HOME = cygpath "$HOME/jtreg" ;
1034           $env:GTEST = cygpath "$env:GITHUB_WORKSPACE/gtest" ;
1035           & bash configure
1036           --with-conf-name=windows-x64
1037           --with-msvc-toolset-version=14.28
1038           ${{ matrix.flags }}
1039           --with-version-opt="$env:GITHUB_ACTOR-$env:GITHUB_SHA"
1040           --with-version-build=0
1041           --with-boot-jdk="$env:BOOT_JDK"
1042           --with-jtreg="$env:JT_HOME"
1043           --with-gtest="$env:GTEST"
1044           --with-default-make-target="product-bundles test-bundles"
1045           --enable-jtreg-failure-handler
1046         working-directory: jdk
1047 
1048       - name: Build
1049         run: |
1050           $env:Path = "$HOME\cygwin\cygwin64\bin;$HOME\cygwin\cygwin64\bin;$env:Path" ;
1051           $env:Path = $env:Path -split ";" -match "C:\\Windows|PowerShell|cygwin" -join ";" ;
1052           & make CONF_NAME=windows-x64
1053         working-directory: jdk
1054 
1055       - name: Persist test bundles
1056         uses: actions/upload-artifact@v2
1057         with:
1058           name: transient_jdk-windows-x64${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }}
1059           path: |
1060             jdk/build/windows-x64/bundles/jdk-${{ env.JDK_VERSION }}-internal+0_windows-x64_bin${{ matrix.artifact }}.zip
1061             jdk/build/windows-x64/bundles/jdk-${{ env.JDK_VERSION }}-internal+0_windows-x64_bin-tests${{ matrix.artifact }}.tar.gz
1062             jdk/build/windows-x64/bundles/jdk-${{ env.JDK_VERSION }}-internal+0_windows-x64_bin${{ matrix.artifact }}-symbols.tar.gz
1063 
1064   windows_x64_test:
1065     name: Windows x64
1066     runs-on: "windows-2019"
1067     needs:
1068       - prerequisites
1069       - windows_x64_build
1070 
1071     strategy:
1072       fail-fast: false
1073       matrix:
1074         test:
1075           - jdk/tier1 part 1
1076           - jdk/tier1 part 2
1077           - jdk/tier1 part 3
1078           - langtools/tier1
1079           - hs/tier1 common
1080           - hs/tier1 compiler
1081           - hs/tier1 gc
1082           - hs/tier1 runtime
1083           - hs/tier1 serviceability
1084         include:
1085           - test: jdk/tier1 part 1
1086             suites: test/jdk/:tier1_part1
1087           - test: jdk/tier1 part 2
1088             suites: test/jdk/:tier1_part2
1089           - test: jdk/tier1 part 3
1090             suites: test/jdk/:tier1_part3
1091           - test: langtools/tier1
1092             suites: test/langtools/:tier1
1093           - test: hs/tier1 common
1094             suites: test/hotspot/jtreg/:tier1_common
1095             artifact: -debug
1096           - test: hs/tier1 compiler
1097             suites: test/hotspot/jtreg/:tier1_compiler
1098             artifact: -debug
1099           - test: hs/tier1 gc
1100             suites: test/hotspot/jtreg/:tier1_gc
1101             artifact: -debug
1102           - test: hs/tier1 runtime
1103             suites: test/hotspot/jtreg/:tier1_runtime
1104             artifact: -debug
1105           - test: hs/tier1 serviceability
1106             suites: test/hotspot/jtreg/:tier1_serviceability
1107             artifact: -debug
1108 
1109     env:
1110       JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_FEATURE }}"
1111       BOOT_JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).BOOT_JDK_VERSION }}"
1112       BOOT_JDK_FILENAME: "${{ fromJson(needs.prerequisites.outputs.dependencies).WINDOWS_X64_BOOT_JDK_FILENAME }}"
1113       BOOT_JDK_URL: "${{ fromJson(needs.prerequisites.outputs.dependencies).WINDOWS_X64_BOOT_JDK_URL }}"
1114       BOOT_JDK_SHA256: "${{ fromJson(needs.prerequisites.outputs.dependencies).WINDOWS_X64_BOOT_JDK_SHA256 }}"
1115 
1116     steps:
1117       - name: Checkout the source
1118         uses: actions/checkout@v2
1119 
1120       - name: Restore boot JDK from cache
1121         id: bootjdk
1122         uses: actions/cache@v2
1123         with:
1124           path: ~/bootjdk/${{ env.BOOT_JDK_VERSION }}
1125           key: bootjdk-${{ runner.os }}-${{ env.BOOT_JDK_VERSION }}-${{ env.BOOT_JDK_SHA256 }}-v1
1126 
1127       - name: Download boot JDK
1128         run: |
1129           mkdir -p "$HOME\bootjdk\$env:BOOT_JDK_VERSION"
1130           & curl -L "$env:BOOT_JDK_URL" -o "$HOME/bootjdk/$env:BOOT_JDK_FILENAME"
1131           $FileHash = Get-FileHash -Algorithm SHA256 "$HOME/bootjdk/$env:BOOT_JDK_FILENAME"
1132           $FileHash.Hash -eq $env:BOOT_JDK_SHA256
1133           & tar -xf "$HOME/bootjdk/$env:BOOT_JDK_FILENAME" -C "$HOME/bootjdk/$env:BOOT_JDK_VERSION"
1134           Get-ChildItem "$HOME\bootjdk\$env:BOOT_JDK_VERSION\*\*" | Move-Item -Destination "$HOME\bootjdk\$env:BOOT_JDK_VERSION"
1135         if: steps.bootjdk.outputs.cache-hit != 'true'
1136 
1137       - name: Restore cygwin packages from cache
1138         id: cygwin
1139         uses: actions/cache@v2
1140         with:
1141           path: ~/cygwin/packages
1142           key: cygwin-packages-${{ runner.os }}-v1
1143 
1144       - name: Install cygwin
1145         run: |
1146           New-Item -Force -ItemType directory -Path "$HOME\cygwin"
1147           & curl -L "https://www.cygwin.com/setup-x86_64.exe" -o "$HOME/cygwin/setup-x86_64.exe"
1148           Start-Process -FilePath "$HOME\cygwin\setup-x86_64.exe" -ArgumentList "--quiet-mode --packages autoconf,make,zip,unzip --root $HOME\cygwin\cygwin64 --local-package-dir $HOME\cygwin\packages --site http://mirrors.kernel.org/sourceware/cygwin --no-desktop --no-shortcuts --no-startmenu --no-admin" -Wait -NoNewWindow
1149 
1150       - name: Restore jtreg artifact
1151         id: jtreg_restore
1152         uses: actions/download-artifact@v2
1153         with:
1154           name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }}
1155           path: ~/jtreg/
1156         continue-on-error: true
1157 
1158       - name: Restore jtreg artifact (retry)
1159         uses: actions/download-artifact@v2
1160         with:
1161           name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }}
1162           path: ~/jtreg/
1163         if: steps.jtreg_restore.outcome == 'failure'
1164 
1165       - name: Restore build artifacts
1166         id: build_restore
1167         uses: actions/download-artifact@v2
1168         with:
1169           name: transient_jdk-windows-x64${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }}
1170           path: ~/jdk-windows-x64${{ matrix.artifact }}
1171         continue-on-error: true
1172 
1173       - name: Restore build artifacts (retry)
1174         uses: actions/download-artifact@v2
1175         with:
1176           name: transient_jdk-windows-x64${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }}
1177           path: ~/jdk-windows-x64${{ matrix.artifact }}
1178         if: steps.build_restore.outcome == 'failure'
1179 
1180       - name: Unpack jdk
1181         run: |
1182           mkdir -p "${HOME}/jdk-windows-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_windows-x64_bin${{ matrix.artifact }}"
1183           tar -xf "${HOME}/jdk-windows-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_windows-x64_bin${{ matrix.artifact }}.zip" -C "${HOME}/jdk-windows-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_windows-x64_bin${{ matrix.artifact }}"
1184 
1185       - name: Unpack symbols
1186         run: |
1187           mkdir -p "${HOME}/jdk-windows-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_windows-x64_bin${{ matrix.artifact }}-symbols"
1188           tar -xf "${HOME}/jdk-windows-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_windows-x64_bin${{ matrix.artifact }}-symbols.tar.gz" -C "${HOME}/jdk-windows-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_windows-x64_bin${{ matrix.artifact }}-symbols"
1189 
1190       - name: Unpack tests
1191         run: |
1192           mkdir -p "${HOME}/jdk-windows-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_windows-x64_bin-tests${{ matrix.artifact }}"
1193           tar -xf "${HOME}/jdk-windows-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_windows-x64_bin-tests${{ matrix.artifact }}.tar.gz" -C "${HOME}/jdk-windows-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_windows-x64_bin-tests${{ matrix.artifact }}"
1194 
1195       - name: Find root of jdk image dir
1196         run: echo ("imageroot=" + (Get-ChildItem -Path $HOME/jdk-windows-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_windows-x64_bin${{ matrix.artifact }} -Filter release -Recurse -ErrorAction SilentlyContinue -Force).DirectoryName) | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8
1197 
1198       - name: Run tests
1199         run: >
1200           $env:Path = "$HOME\cygwin\cygwin64\bin;$HOME\cygwin\cygwin64\bin;$env:Path" ;
1201           $env:Path = $env:Path -split ";" -match "C:\\Windows|PowerShell|cygwin" -join ";" ;
1202           $env:JDK_IMAGE_DIR = cygpath "${{ env.imageroot }}" ;
1203           $env:SYMBOLS_IMAGE_DIR = cygpath "${{ env.imageroot }}" ;
1204           $env:TEST_IMAGE_DIR = cygpath "$HOME/jdk-windows-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_windows-x64_bin-tests${{ matrix.artifact }}" ;
1205           $env:BOOT_JDK = cygpath "$HOME/bootjdk/$env:BOOT_JDK_VERSION" ;
1206           $env:JT_HOME = cygpath "$HOME/jtreg" ;
1207           & make test-prebuilt
1208           CONF_NAME=run-test-prebuilt
1209           LOG_CMDLINES=true
1210           JTREG_VERBOSE=fail,error,time
1211           TEST=${{ matrix.suites }}
1212           TEST_OPTS_JAVA_OPTIONS=
1213           JTREG_KEYWORDS="!headful"
1214           JTREG="JAVA_OPTIONS=-XX:-CreateCoredumpOnCrash"
1215 
1216       - name: Check that all tests executed successfully
1217         if: always()
1218         run: >
1219           if ((Get-ChildItem -Path build\*\test-results\test-summary.txt -Recurse | Select-String -Pattern "TEST SUCCESS" ).Count -eq 0) {
1220             Get-Content -Path build\*\test-results\*\*\newfailures.txt ;
1221             exit 1
1222           }
1223 
1224       - name: Create suitable test log artifact name
1225         if: always()
1226         run: echo ("logsuffix=" + ("${{ matrix.test }}" -replace "/", "_" -replace " ", "_")) | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8
1227 
1228       - name: Package test results
1229         if: always()
1230         working-directory: build/run-test-prebuilt/test-results/
1231         run: >
1232           $env:Path = "$HOME\cygwin\cygwin64\bin;$env:Path" ;
1233           zip -r9
1234           "$HOME/windows-x64${{ matrix.artifact }}_testresults_${{ env.logsuffix }}.zip"
1235           .
1236         continue-on-error: true
1237 
1238       - name: Package test support
1239         if: always()
1240         working-directory: build/run-test-prebuilt/test-support/
1241         run: >
1242           $env:Path = "$HOME\cygwin\cygwin64\bin;$env:Path" ;
1243           zip -r9
1244           "$HOME/windows-x64${{ matrix.artifact }}_testsupport_${{ env.logsuffix }}.zip"
1245           .
1246           -i *.jtr
1247           -i */hs_err*.log
1248           -i */replay*.log
1249         continue-on-error: true
1250 
1251       - name: Persist test results
1252         if: always()
1253         uses: actions/upload-artifact@v2
1254         with:
1255           path: ~/windows-x64${{ matrix.artifact }}_testresults_${{ env.logsuffix }}.zip
1256         continue-on-error: true
1257 
1258       - name: Persist test outputs
1259         if: always()
1260         uses: actions/upload-artifact@v2
1261         with:
1262           path: ~/windows-x64${{ matrix.artifact }}_testsupport_${{ env.logsuffix }}.zip
1263         continue-on-error: true
1264 
1265   macos_x64_build:
1266     name: macOS x64
1267     runs-on: "macos-10.15"
1268     needs: prerequisites
1269     if: needs.prerequisites.outputs.should_run != 'false' && needs.prerequisites.outputs.platform_macos_x64 != 'false'
1270 
1271     strategy:
1272       fail-fast: false
1273       matrix:
1274         flavor:
1275           - build release
1276           - build debug
1277         include:
1278           - flavor: build release
1279           - flavor: build debug
1280             flags: --enable-debug
1281             artifact: -debug
1282 
1283     env:
1284       JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_FEATURE }}"
1285       BOOT_JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).BOOT_JDK_VERSION }}"
1286       BOOT_JDK_FILENAME: "${{ fromJson(needs.prerequisites.outputs.dependencies).MACOS_X64_BOOT_JDK_FILENAME }}"
1287       BOOT_JDK_URL: "${{ fromJson(needs.prerequisites.outputs.dependencies).MACOS_X64_BOOT_JDK_URL }}"
1288       BOOT_JDK_SHA256: "${{ fromJson(needs.prerequisites.outputs.dependencies).MACOS_X64_BOOT_JDK_SHA256 }}"
1289 
1290     steps:
1291       - name: Checkout the source
1292         uses: actions/checkout@v2
1293         with:
1294           path: jdk
1295 
1296       - name: Restore boot JDK from cache
1297         id: bootjdk
1298         uses: actions/cache@v2
1299         with:
1300           path: ~/bootjdk/${{ env.BOOT_JDK_VERSION }}
1301           key: bootjdk-${{ runner.os }}-${{ env.BOOT_JDK_VERSION }}-${{ env.BOOT_JDK_SHA256 }}-v1
1302 
1303       - name: Download boot JDK
1304         run: |
1305           mkdir -p ${HOME}/bootjdk/${BOOT_JDK_VERSION} || true
1306           wget -O "${HOME}/bootjdk/${BOOT_JDK_FILENAME}" "${BOOT_JDK_URL}"
1307           echo "${BOOT_JDK_SHA256}  ${HOME}/bootjdk/${BOOT_JDK_FILENAME}" | shasum -a 256 -c >/dev/null -
1308           tar -xf "${HOME}/bootjdk/${BOOT_JDK_FILENAME}" -C "${HOME}/bootjdk/${BOOT_JDK_VERSION}"
1309           mv "${HOME}/bootjdk/${BOOT_JDK_VERSION}/"*/* "${HOME}/bootjdk/${BOOT_JDK_VERSION}/"
1310         if: steps.bootjdk.outputs.cache-hit != 'true'
1311 
1312       - name: Restore jtreg artifact
1313         id: jtreg_restore
1314         uses: actions/download-artifact@v2
1315         with:
1316           name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }}
1317           path: ~/jtreg/
1318         continue-on-error: true
1319 
1320       - name: Restore jtreg artifact (retry)
1321         uses: actions/download-artifact@v2
1322         with:
1323           name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }}
1324           path: ~/jtreg/
1325         if: steps.jtreg_restore.outcome == 'failure'
1326 
1327       - name: Checkout gtest sources
1328         uses: actions/checkout@v2
1329         with:
1330           repository: "google/googletest"
1331           ref: "release-${{ fromJson(needs.prerequisites.outputs.dependencies).GTEST_VERSION }}"
1332           path: gtest
1333 
1334       - name: Install dependencies
1335         run: brew install make
1336 
1337       - name: Select Xcode version
1338         run: sudo xcode-select --switch /Applications/Xcode_11.3.1.app/Contents/Developer
1339 
1340       - name: Configure
1341         run: >
1342           bash configure
1343           --with-conf-name=macos-x64
1344           ${{ matrix.flags }}
1345           --with-version-opt=${GITHUB_ACTOR}-${GITHUB_SHA}
1346           --with-version-build=0
1347           --with-boot-jdk=${HOME}/bootjdk/${BOOT_JDK_VERSION}/Contents/Home
1348           --with-jtreg=${HOME}/jtreg
1349           --with-gtest=${GITHUB_WORKSPACE}/gtest
1350           --with-default-make-target="product-bundles test-bundles"
1351           --with-zlib=system
1352           --enable-jtreg-failure-handler
1353         working-directory: jdk
1354 
1355       - name: Build
1356         run: make CONF_NAME=macos-x64
1357         working-directory: jdk
1358 
1359       - name: Persist test bundles
1360         uses: actions/upload-artifact@v2
1361         with:
1362           name: transient_jdk-macos-x64${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }}
1363           path: |
1364             jdk/build/macos-x64/bundles/jdk-${{ env.JDK_VERSION }}-internal+0_macos-x64_bin${{ matrix.artifact }}.tar.gz
1365             jdk/build/macos-x64/bundles/jdk-${{ env.JDK_VERSION }}-internal+0_macos-x64_bin-tests${{ matrix.artifact }}.tar.gz
1366 
1367   macos_aarch64_build:
1368     name: macOS aarch64
1369     runs-on: "macos-10.15"
1370     needs: prerequisites
1371     if: needs.prerequisites.outputs.should_run != 'false' && needs.prerequisites.outputs.platform_macos_aarch64 != 'false'
1372 
1373     strategy:
1374       fail-fast: false
1375       matrix:
1376         flavor:
1377           - build release
1378           - build debug
1379         include:
1380           - flavor: build release
1381           - flavor: build debug
1382             flags: --enable-debug
1383             artifact: -debug
1384 
1385     env:
1386       JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_FEATURE }}"
1387       BOOT_JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).BOOT_JDK_VERSION }}"
1388       BOOT_JDK_FILENAME: "${{ fromJson(needs.prerequisites.outputs.dependencies).MACOS_X64_BOOT_JDK_FILENAME }}"
1389       BOOT_JDK_URL: "${{ fromJson(needs.prerequisites.outputs.dependencies).MACOS_X64_BOOT_JDK_URL }}"
1390       BOOT_JDK_SHA256: "${{ fromJson(needs.prerequisites.outputs.dependencies).MACOS_X64_BOOT_JDK_SHA256 }}"
1391 
1392     steps:
1393       - name: Checkout the source
1394         uses: actions/checkout@v2
1395         with:
1396           path: jdk
1397 
1398       - name: Restore boot JDK from cache
1399         id: bootjdk
1400         uses: actions/cache@v2
1401         with:
1402           path: ~/bootjdk/${{ env.BOOT_JDK_VERSION }}
1403           key: bootjdk-${{ runner.os }}-${{ env.BOOT_JDK_VERSION }}-${{ env.BOOT_JDK_SHA256 }}-v1
1404 
1405       - name: Download boot JDK
1406         run: |
1407           mkdir -p ${HOME}/bootjdk/${BOOT_JDK_VERSION} || true
1408           wget -O "${HOME}/bootjdk/${BOOT_JDK_FILENAME}" "${BOOT_JDK_URL}"
1409           echo "${BOOT_JDK_SHA256}  ${HOME}/bootjdk/${BOOT_JDK_FILENAME}" | shasum -a 256 -c >/dev/null -
1410           tar -xf "${HOME}/bootjdk/${BOOT_JDK_FILENAME}" -C "${HOME}/bootjdk/${BOOT_JDK_VERSION}"
1411           mv "${HOME}/bootjdk/${BOOT_JDK_VERSION}/"*/* "${HOME}/bootjdk/${BOOT_JDK_VERSION}/"
1412         if: steps.bootjdk.outputs.cache-hit != 'true'
1413 
1414       - name: Restore jtreg artifact
1415         id: jtreg_restore
1416         uses: actions/download-artifact@v2
1417         with:
1418           name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }}
1419           path: ~/jtreg/
1420         continue-on-error: true
1421 
1422       - name: Restore jtreg artifact (retry)
1423         uses: actions/download-artifact@v2
1424         with:
1425           name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }}
1426           path: ~/jtreg/
1427         if: steps.jtreg_restore.outcome == 'failure'
1428 
1429       - name: Checkout gtest sources
1430         uses: actions/checkout@v2
1431         with:
1432           repository: "google/googletest"
1433           ref: "release-${{ fromJson(needs.prerequisites.outputs.dependencies).GTEST_VERSION }}"
1434           path: gtest
1435 
1436       - name: Install dependencies
1437         run: brew install make
1438 
1439       - name: Select Xcode version
1440         run: sudo xcode-select --switch /Applications/Xcode_12.4.app/Contents/Developer
1441 
1442       - name: Configure
1443         run: >
1444           bash configure
1445           --with-conf-name=macos-aarch64
1446           --openjdk-target=aarch64-apple-darwin
1447           ${{ matrix.flags }}
1448           --with-version-opt=${GITHUB_ACTOR}-${GITHUB_SHA}
1449           --with-version-build=0
1450           --with-boot-jdk=${HOME}/bootjdk/${BOOT_JDK_VERSION}/Contents/Home
1451           --with-jtreg=${HOME}/jtreg
1452           --with-gtest=${GITHUB_WORKSPACE}/gtest
1453           --with-default-make-target="product-bundles test-bundles"
1454           --with-zlib=system
1455           --enable-jtreg-failure-handler
1456         working-directory: jdk
1457 
1458       - name: Build
1459         run: make CONF_NAME=macos-aarch64
1460         working-directory: jdk
1461 
1462       - name: Persist test bundles
1463         uses: actions/upload-artifact@v2
1464         with:
1465           name: transient_jdk-macos-aarch64${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }}
1466           path: |
1467             jdk/build/macos-aarch64/bundles/jdk-${{ env.JDK_VERSION }}-internal+0_macos-aarch64_bin${{ matrix.artifact }}.tar.gz
1468             jdk/build/macos-aarch64/bundles/jdk-${{ env.JDK_VERSION }}-internal+0_macos-aarch64_bin-tests${{ matrix.artifact }}.tar.gz
1469 
1470 
1471   macos_x64_test:
1472     name: macOS x64
1473     runs-on: "macos-10.15"
1474     needs:
1475       - prerequisites
1476       - macos_x64_build
1477 
1478     strategy:
1479       fail-fast: false
1480       matrix:
1481         test:
1482           - jdk/tier1 part 1
1483           - jdk/tier1 part 2
1484           - jdk/tier1 part 3
1485           - langtools/tier1
1486           - hs/tier1 common
1487           - hs/tier1 compiler
1488           - hs/tier1 gc
1489           - hs/tier1 runtime
1490           - hs/tier1 serviceability
1491         include:
1492           - test: jdk/tier1 part 1
1493             suites: test/jdk/:tier1_part1
1494           - test: jdk/tier1 part 2
1495             suites: test/jdk/:tier1_part2
1496           - test: jdk/tier1 part 3
1497             suites: test/jdk/:tier1_part3
1498           - test: langtools/tier1
1499             suites: test/langtools/:tier1
1500           - test: hs/tier1 common
1501             suites: test/hotspot/jtreg/:tier1_common
1502             artifact: -debug
1503           - test: hs/tier1 compiler
1504             suites: test/hotspot/jtreg/:tier1_compiler
1505             artifact: -debug
1506           - test: hs/tier1 gc
1507             suites: test/hotspot/jtreg/:tier1_gc
1508             artifact: -debug
1509           - test: hs/tier1 runtime
1510             suites: test/hotspot/jtreg/:tier1_runtime
1511             artifact: -debug
1512           - test: hs/tier1 serviceability
1513             suites: test/hotspot/jtreg/:tier1_serviceability
1514             artifact: -debug
1515 
1516     env:
1517       JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).DEFAULT_VERSION_FEATURE }}"
1518       BOOT_JDK_VERSION: "${{ fromJson(needs.prerequisites.outputs.dependencies).BOOT_JDK_VERSION }}"
1519       BOOT_JDK_FILENAME: "${{ fromJson(needs.prerequisites.outputs.dependencies).MACOS_X64_BOOT_JDK_FILENAME }}"
1520       BOOT_JDK_URL: "${{ fromJson(needs.prerequisites.outputs.dependencies).MACOS_X64_BOOT_JDK_URL }}"
1521       BOOT_JDK_SHA256: "${{ fromJson(needs.prerequisites.outputs.dependencies).MACOS_X64_BOOT_JDK_SHA256 }}"
1522 
1523     steps:
1524       - name: Checkout the source
1525         uses: actions/checkout@v2
1526 
1527       - name: Restore boot JDK from cache
1528         id: bootjdk
1529         uses: actions/cache@v2
1530         with:
1531           path: ~/bootjdk/${{ env.BOOT_JDK_VERSION }}
1532           key: bootjdk-${{ runner.os }}-${{ env.BOOT_JDK_VERSION }}-${{ env.BOOT_JDK_SHA256 }}-v1
1533 
1534       - name: Download boot JDK
1535         run: |
1536           mkdir -p ${HOME}/bootjdk/${BOOT_JDK_VERSION} || true
1537           wget -O "${HOME}/bootjdk/${BOOT_JDK_FILENAME}" "${BOOT_JDK_URL}"
1538           echo "${BOOT_JDK_SHA256}  ${HOME}/bootjdk/${BOOT_JDK_FILENAME}" | shasum -a 256 -c >/dev/null -
1539           tar -xf "${HOME}/bootjdk/${BOOT_JDK_FILENAME}" -C "${HOME}/bootjdk/${BOOT_JDK_VERSION}"
1540           mv "${HOME}/bootjdk/${BOOT_JDK_VERSION}/"*/* "${HOME}/bootjdk/${BOOT_JDK_VERSION}/"
1541         if: steps.bootjdk.outputs.cache-hit != 'true'
1542 
1543       - name: Restore jtreg artifact
1544         id: jtreg_restore
1545         uses: actions/download-artifact@v2
1546         with:
1547           name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }}
1548           path: ~/jtreg/
1549         continue-on-error: true
1550 
1551       - name: Restore jtreg artifact (retry)
1552         uses: actions/download-artifact@v2
1553         with:
1554           name: transient_jtreg_${{ needs.prerequisites.outputs.bundle_id }}
1555           path: ~/jtreg/
1556         if: steps.jtreg_restore.outcome == 'failure'
1557 
1558       - name: Restore build artifacts
1559         id: build_restore
1560         uses: actions/download-artifact@v2
1561         with:
1562           name: transient_jdk-macos-x64${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }}
1563           path: ~/jdk-macos-x64${{ matrix.artifact }}
1564         continue-on-error: true
1565 
1566       - name: Restore build artifacts (retry)
1567         uses: actions/download-artifact@v2
1568         with:
1569           name: transient_jdk-macos-x64${{ matrix.artifact }}_${{ needs.prerequisites.outputs.bundle_id }}
1570           path: ~/jdk-macos-x64${{ matrix.artifact }}
1571         if: steps.build_restore.outcome == 'failure'
1572 
1573       - name: Unpack jdk
1574         run: |
1575           mkdir -p "${HOME}/jdk-macos-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_macos-x64_bin${{ matrix.artifact }}"
1576           tar -xf "${HOME}/jdk-macos-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_macos-x64_bin${{ matrix.artifact }}.tar.gz" -C "${HOME}/jdk-macos-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_macos-x64_bin${{ matrix.artifact }}"
1577 
1578       - name: Unpack tests
1579         run: |
1580           mkdir -p "${HOME}/jdk-macos-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_macos-x64_bin-tests${{ matrix.artifact }}"
1581           tar -xf "${HOME}/jdk-macos-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_macos-x64_bin-tests${{ matrix.artifact }}.tar.gz" -C "${HOME}/jdk-macos-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_macos-x64_bin-tests${{ matrix.artifact }}"
1582 
1583       - name: Install dependencies
1584         run: brew install make
1585 
1586       - name: Select Xcode version
1587         run: sudo xcode-select --switch /Applications/Xcode_11.3.1.app/Contents/Developer
1588 
1589       - name: Find root of jdk image dir
1590         run: |
1591           imageroot=`find ${HOME}/jdk-macos-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_macos-x64_bin${{ matrix.artifact }} -name release -type f`
1592           echo "imageroot=`dirname ${imageroot}`" >> $GITHUB_ENV
1593 
1594       - name: Run tests
1595         run: >
1596           JDK_IMAGE_DIR=${{ env.imageroot }}
1597           TEST_IMAGE_DIR=${HOME}/jdk-macos-x64${{ matrix.artifact }}/jdk-${{ env.JDK_VERSION }}-internal+0_macos-x64_bin-tests${{ matrix.artifact }}
1598           BOOT_JDK=${HOME}/bootjdk/${BOOT_JDK_VERSION}/Contents/Home
1599           JT_HOME=${HOME}/jtreg
1600           gmake test-prebuilt
1601           CONF_NAME=run-test-prebuilt
1602           LOG_CMDLINES=true
1603           JTREG_VERBOSE=fail,error,time
1604           TEST=${{ matrix.suites }}
1605           TEST_OPTS_JAVA_OPTIONS=
1606           JTREG_KEYWORDS="!headful"
1607           JTREG="JAVA_OPTIONS=-XX:-CreateCoredumpOnCrash"
1608 
1609       - name: Check that all tests executed successfully
1610         if: always()
1611         run: >
1612           if ! grep --include=test-summary.txt -lqr build/*/test-results -e "TEST SUCCESS" ; then
1613             cat build/*/test-results/*/text/newfailures.txt ;
1614             exit 1 ;
1615           fi
1616 
1617       - name: Create suitable test log artifact name
1618         if: always()
1619         run: echo "logsuffix=`echo ${{ matrix.test }} | sed -e 's!/!_!'g -e 's! !_!'g`" >> $GITHUB_ENV
1620 
1621       - name: Package test results
1622         if: always()
1623         working-directory: build/run-test-prebuilt/test-results/
1624         run: >
1625           zip -r9
1626           "$HOME/macos-x64${{ matrix.artifact }}_testresults_${{ env.logsuffix }}.zip"
1627           .
1628         continue-on-error: true
1629 
1630       - name: Package test support
1631         if: always()
1632         working-directory: build/run-test-prebuilt/test-support/
1633         run: >
1634           zip -r9
1635           "$HOME/macos-x64${{ matrix.artifact }}_testsupport_${{ env.logsuffix }}.zip"
1636           .
1637           -i *.jtr
1638           -i */hs_err*.log
1639           -i */replay*.log
1640         continue-on-error: true
1641 
1642       - name: Persist test results
1643         if: always()
1644         uses: actions/upload-artifact@v2
1645         with:
1646           path: ~/macos-x64${{ matrix.artifact }}_testresults_${{ env.logsuffix }}.zip
1647         continue-on-error: true
1648 
1649       - name: Persist test outputs
1650         if: always()
1651         uses: actions/upload-artifact@v2
1652         with:
1653           path: ~/macos-x64${{ matrix.artifact }}_testsupport_${{ env.logsuffix }}.zip
1654         continue-on-error: true
1655 
1656   artifacts:
1657     name: Post-process artifacts
1658     runs-on: "ubuntu-20.04"
1659     if: always()
1660     continue-on-error: true
1661     needs:
1662       - prerequisites
1663       - linux_additional_build
1664       - windows_aarch64_build
1665       - linux_x64_test
1666       - linux_x86_test
1667       - windows_x64_test
1668       - macos_x64_test
1669       - macos_aarch64_build
1670 
1671     steps:
1672       - name: Determine current artifacts endpoint
1673         id: actions_runtime
1674         uses: actions/github-script@v3
1675         with:
1676           script: "return { url: process.env['ACTIONS_RUNTIME_URL'], token: process.env['ACTIONS_RUNTIME_TOKEN'] }"
1677 
1678       - name: Display current artifacts
1679         run: >
1680           curl -s -H 'Accept: application/json;api-version=6.0-preview'
1681           -H 'Authorization: Bearer ${{ fromJson(steps.actions_runtime.outputs.result).token }}'
1682           '${{ fromJson(steps.actions_runtime.outputs.result).url }}_apis/pipelines/workflows/${{ github.run_id }}/artifacts?api-version=6.0-preview'
1683 
1684       - name: Delete transient artifacts
1685         run: >
1686           for url in `
1687           curl -s -H 'Accept: application/json;api-version=6.0-preview'
1688           -H 'Authorization: Bearer ${{ fromJson(steps.actions_runtime.outputs.result).token }}'
1689           '${{ fromJson(steps.actions_runtime.outputs.result).url }}_apis/pipelines/workflows/${{ github.run_id }}/artifacts?api-version=6.0-preview' |
1690           jq -r -c '.value | map(select(.name|startswith("transient_"))) | .[].url'`; do
1691           curl -s -H 'Accept: application/json;api-version=6.0-preview'
1692           -H 'Authorization: Bearer ${{ fromJson(steps.actions_runtime.outputs.result).token }}'
1693           -X DELETE "${url}";
1694           done
1695 
1696       - name: Fetch remaining artifacts (test results)
1697         uses: actions/download-artifact@v2
1698         with:
1699           path: test-results
1700 
1701       - name: Delete remaining artifacts
1702         run: >
1703           for url in `
1704           curl -s -H 'Accept: application/json;api-version=6.0-preview'
1705           -H 'Authorization: Bearer ${{ fromJson(steps.actions_runtime.outputs.result).token }}'
1706           '${{ fromJson(steps.actions_runtime.outputs.result).url }}_apis/pipelines/workflows/${{ github.run_id }}/artifacts?api-version=6.0-preview' |
1707           jq -r -c '.value | .[].url'`; do
1708           curl -s -H 'Accept: application/json;api-version=6.0-preview'
1709           -H 'Authorization: Bearer ${{ fromJson(steps.actions_runtime.outputs.result).token }}'
1710           -X DELETE "${url}";
1711           done
1712 
1713       - name: Upload a combined test results artifact
1714         uses: actions/upload-artifact@v2
1715         with:
1716           name: test-results_${{ needs.prerequisites.outputs.bundle_id }}
1717           path: test-results