jdk
1#
2# Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# This code is free software; you can redistribute it and/or modify it
6# under the terms of the GNU General Public License version 2 only, as
7# published by the Free Software Foundation. Oracle designates this
8# particular file as subject to the "Classpath" exception as provided
9# by Oracle in the LICENSE file that accompanied this code.
10#
11# This code is distributed in the hope that it will be useful, but WITHOUT
12# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14# version 2 for more details (a copy is included in the LICENSE file that
15# accompanied this code).
16#
17# You should have received a copy of the GNU General Public License version
18# 2 along with this work; if not, write to the Free Software Foundation,
19# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20#
21# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22# or visit www.oracle.com if you need additional information or have any
23# questions.
24#
25
26name: 'Do build'27description: 'Build the JDK using make'28inputs:29make-target:30description: 'Make target(s)'31required: true32platform:33description: 'Platform name'34required: true35debug-suffix:36description: 'File name suffix denoting debug level, possibly empty'37required: false38
39runs:40using: composite41steps:42- name: 'Build'43id: build44run: >45make LOG=info ${{ inputs.make-target }}
46|| bash ./.github/scripts/gen-build-failure-report.sh "$GITHUB_STEP_SUMMARY"
47shell: bash48
49- name: 'Check for failure'50id: check51run: |52# Check for failure marker file
53build_dir="$(ls -d build/*)"
54if [[ -e $build_dir/build-failure ]]; then
55# Collect relevant log files
56mkdir failure-logs
57cp \
58$build_dir/spec.gmk \
59$build_dir/build.log \
60$build_dir/configure.log \
61$build_dir/make-support/failure-summary.log \
62$build_dir/make-support/failure-logs/* \
63failure-logs/ 2> /dev/null || true
64echo 'failure=true' >> $GITHUB_OUTPUT
65fi
66shell: bash67
68- name: 'Upload build logs'69uses: actions/upload-artifact@v470with:71name: failure-logs-${{ inputs.platform }}${{ inputs.debug-suffix }}72path: failure-logs73if: steps.check.outputs.failure == 'true'74
75# This is the best way I found to abort the job with an error message76- name: 'Notify about build failures'77uses: actions/github-script@v778with:79script: core.setFailed('Build failed. See summary for details.')80if: steps.check.outputs.failure == 'true'81