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