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