1 name:  "C2 PEA Test"
  2 on:
  3   workflow_dispatch:
  4     inputs:
  5       configure-arguments:
  6         description: 'Additional configure arguments'
  7         required: false
  8       make-arguments:
  9         description: 'Additional make arguments'
 10         required: false
 11   push:
 12     branches:
 13       - PEA_beta
 14   pull_request:
 15     branches:
 16       - PEA_beta
 17 
 18 jobs:
 19   ###
 20   ### Build jobs
 21   ###
 22   build-linux-x64:
 23     name: linux-x64
 24     uses: ./.github/workflows/build-linux.yml
 25     with:
 26       platform: linux-x64
 27       debug-levels: '[ "debug" ]'
 28       gcc-major-version: '10'
 29       configure-arguments: ${{ github.event.inputs.configure-arguments }}
 30       make-arguments: ${{ github.event.inputs.make-arguments }}
 31 
 32   smoke-test:
 33     needs: build-linux-x64
 34     runs-on: ubuntu-22.04
 35     steps:
 36       - name: 'Checkout the JDK source'
 37         uses: actions/checkout@v3
 38 
 39       - name: 'Get bundles'
 40         id: bundles
 41         uses: ./.github/actions/get-bundles
 42         with:
 43           platform: linux-x64
 44           debug-suffix: -debug
 45 
 46       - name: 'Run smoke tests'
 47         id: smoke-test
 48         run:
 49           cd ./PEA && make JAVA_HOME=${{ steps.bundles.outputs.jdk-path }}
 50 
 51         # This is the best way I found to abort the job with an error message
 52       - name: 'Notify about test failures'
 53         uses: actions/github-script@v6
 54         with:
 55           script: core.setFailed('${{ steps.smoke-test.outputs.error-message }}')
 56         if: steps.smoke-test.outputs.failure == 'true'
 57 
 58   ctw-test:
 59     needs: smoke-test
 60     runs-on: ubuntu-22.04
 61     steps:
 62       - name: 'Checkout the JDK source'
 63         uses: actions/checkout@v3
 64 
 65       - name: 'Get bundles'
 66         id: bundles
 67         uses: ./.github/actions/get-bundles
 68         with:
 69           platform: linux-x64
 70           debug-suffix: -debug
 71 
 72       - name: 'Run CTW java.base'
 73         id: ctw-java-base
 74         run: |
 75           cd PEA/
 76           make run-ctw JAVA_HOME=${{ steps.bundles.outputs.jdk-path }}
 77           # run without inliner
 78           make run-ctw-no-inline JAVA_HOME=${{ steps.bundles.outputs.jdk-path }}
 79 
 80       # This is the best way I found to abort the job with an error message
 81       - name: 'Notify about test failures'
 82         uses: actions/github-script@v6
 83         with:
 84           script: core.setFailed('${{ steps.ctw-java-base.outputs.error-message }}')
 85         if: steps.ctw-java-base.outputs.failure == 'true'
 86 
 87   jtreg-tests:
 88     needs: ctw-test
 89     runs-on: ubuntu-22.04
 90     strategy:
 91       fail-fast: false
 92       matrix:
 93         test-name:
 94           - 'jdk/tier1 part 1'
 95           - 'jdk/tier1 part 2'
 96           - 'jdk/tier1 part 3'
 97           - 'langtools/tier1'
 98           - 'hs/tier1 common'
 99           - 'hs/tier1 compiler'
100           - 'hs/tier1 gc'
101           - 'hs/tier1 runtime'
102           - 'hs/tier1 serviceability'
103           - 'lib-test/tier1'
104           - 'hs/tier2'
105           - 'jdk/tier2 part 1'
106           - 'jdk/tier2 part 2'
107           - 'jdk/tier2 part 3'
108 
109 
110         include:
111           - test-name: 'jdk/tier1 part 1'
112             test-suite: 'test/jdk/:tier1_part1'
113 
114           - test-name: 'jdk/tier1 part 2'
115             test-suite: 'test/jdk/:tier1_part2'
116 
117           - test-name: 'jdk/tier1 part 3'
118             test-suite: 'test/jdk/:tier1_part3'
119 
120           - test-name: 'langtools/tier1'
121             test-suite: 'test/langtools/:tier1'
122 
123           - test-name: 'hs/tier1 common'
124             test-suite: 'test/hotspot/jtreg/:tier1_common'
125 
126           - test-name: 'hs/tier1 compiler'
127             test-suite: 'test/hotspot/jtreg/:tier1_compiler'
128 
129           - test-name: 'hs/tier1 gc'
130             test-suite: 'test/hotspot/jtreg/:tier1_gc'
131 
132           - test-name: 'hs/tier1 runtime'
133             test-suite: 'test/hotspot/jtreg/:tier1_runtime'
134 
135           - test-name: 'hs/tier1 serviceability'
136             test-suite: 'test/hotspot/jtreg/:tier1_serviceability'
137 
138           - test-name: 'lib-test/tier1'
139             test-suite: 'test/lib-test/:tier1'
140 
141           - test-name: 'hs/tier2'
142             test-suite: 'hotspot:tier2'
143 
144           - test-name: 'jdk/tier2 part 1'
145             test-suite: 'test/jdk/:tier2_part1'
146 
147           - test-name: 'jdk/tier2 part 2'
148             test-suite: 'test/jdk/:tier2_part2'
149 
150           - test-name: 'jdk/tier2 part 3'
151             test-suite: 'test/jdk/:tier2_part3'
152 
153     steps:
154       - name: 'Checkout the JDK source'
155         uses: actions/checkout@v3
156 
157       - name: 'Get bundles'
158         id: bundles
159         uses: ./.github/actions/get-bundles
160         with:
161           platform: linux-x64
162           debug-suffix: -debug
163 
164       - name: 'Get the BootJDK'
165         id: bootjdk
166         uses: ./.github/actions/get-bootjdk
167         with:
168           platform: linux-x64
169 
170       - name: 'Get JTReg'
171         id: jtreg
172         uses: ./.github/actions/get-jtreg
173 
174       - name: 'Run tests'
175         id: run-tests
176         run: >
177           make test-prebuilt
178           TEST='${{ matrix.test-suite }}'
179           BOOT_JDK=${{ steps.bootjdk.outputs.path }}
180           JT_HOME=${{ steps.jtreg.outputs.path }}
181           JDK_IMAGE_DIR=${{ steps.bundles.outputs.jdk-path }}
182           SYMBOLS_IMAGE_DIR=${{ steps.bundles.outputs.symbols-path }}
183           TEST_IMAGE_DIR=${{ steps.bundles.outputs.tests-path }}
184           JTREG='JAVA_OPTIONS=-XX:-CreateCoredumpOnCrash -XX:+UnlockExperimentalVMOptions -XX:+DoPartialEscapeAnalysis;VERBOSE=fail,error,time;KEYWORDS=!headful'
185           && bash ./.github/scripts/gen-test-summary.sh "$GITHUB_STEP_SUMMARY" "$GITHUB_OUTPUT"
186 
187         # This is a separate step, since if the markdown from a step gets bigger than
188         # 1024 kB it is skipped, but then the short summary above is still generated
189       - name: 'Generate test report'
190         run: bash ./.github/scripts/gen-test-results.sh "$GITHUB_STEP_SUMMARY"
191         if: always()
192 
193       - name: 'Package test results'
194         id: package
195         run: |
196           # Package test-results and relevant parts of test-support
197           mkdir results
198 
199           if [[ -d build/run-test-prebuilt/test-results ]]; then
200             cd build/run-test-prebuilt/test-results/
201             zip -r -9 "$GITHUB_WORKSPACE/results/test-results.zip" .
202             cd $GITHUB_WORKSPACE
203           else
204             echo '::warning ::Missing test-results directory'
205           fi
206 
207           if [[ -d build/run-test-prebuilt/test-support ]]; then
208             cd build/run-test-prebuilt/test-support/
209             zip -r -9 "$GITHUB_WORKSPACE/results/test-support.zip" . -i *.jtr -i */hs_err*.log -i */replay*.log
210             cd $GITHUB_WORKSPACE
211           else
212             echo '::warning ::Missing test-support directory'
213           fi
214 
215           artifact_name="results-linux-x64-$(echo ${{ matrix.test-name }} | tr '/ ' '__')"
216           echo "artifact-name=$artifact_name" >> $GITHUB_OUTPUT
217         if: always()
218 
219       - name: 'Upload test results'
220         uses: actions/upload-artifact@v3
221         with:
222           path: results
223           name: ${{ steps.package.outputs.artifact-name }}
224         if: always()
225 
226         # This is the best way I found to abort the job with an error message
227       - name: 'Notify about test failures'
228         uses: actions/github-script@v6
229         with:
230           script: core.setFailed('${{ steps.run-tests.outputs.error-message }}')
231         if: steps.run-tests.outputs.failure == 'true'