jdk
1#
2# Copyright (c) 2022, 2023, 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: 'Build (windows)'27
28on:29workflow_call:30inputs:31platform:32required: true33type: string34extra-conf-options:35required: false36type: string37make-target:38required: false39type: string40default: 'product-bundles test-bundles'41debug-levels:42required: false43type: string44default: '[ "debug", "release" ]'45msvc-toolset-version:46required: true47type: string48msvc-toolset-architecture:49required: true50type: string51configure-arguments:52required: false53type: string54make-arguments:55required: false56type: string57
58env:59# These are needed to make the MSYS2 bash work properly60MSYS2_PATH_TYPE: minimal61CHERE_INVOKING: 162
63jobs:64build-windows:65name: build66runs-on: windows-201967defaults:68run:69shell: bash70
71strategy:72fail-fast: false73matrix:74debug-level: ${{ fromJSON(inputs.debug-levels) }}75include:76- debug-level: debug77flags: --with-debug-level=fastdebug78suffix: -debug79
80steps:81- name: 'Checkout the JDK source'82uses: actions/checkout@v483
84- name: 'Get MSYS2'85uses: ./.github/actions/get-msys286
87- name: 'Get the BootJDK'88id: bootjdk89uses: ./.github/actions/get-bootjdk90with:91platform: windows-x6492
93- name: 'Get JTReg'94id: jtreg95uses: ./.github/actions/get-jtreg96
97- name: 'Get GTest'98id: gtest99uses: ./.github/actions/get-gtest100
101- name: 'Check toolchain installed'102id: toolchain-check103run: |104set +e
105'/c/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/vc/auxiliary/build/vcvars64.bat' -vcvars_ver=${{ inputs.msvc-toolset-version }}
106if [ $? -eq 0 ]; then
107echo "Toolchain is already installed"
108echo "toolchain-installed=true" >> $GITHUB_OUTPUT
109else
110echo "Toolchain is not yet installed"
111echo "toolchain-installed=false" >> $GITHUB_OUTPUT
112fi
113
114- name: 'Install toolchain and dependencies'115run: |116# Run Visual Studio Installer
117'/c/Program Files (x86)/Microsoft Visual Studio/Installer/vs_installer.exe' \
118modify --quiet --installPath 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise' \
119--add Microsoft.VisualStudio.Component.VC.${{ inputs.msvc-toolset-version }}.${{ inputs.msvc-toolset-architecture }}
120if: steps.toolchain-check.outputs.toolchain-installed != 'true'121
122- name: 'Configure'123run: >124bash configure
125--with-conf-name=${{ inputs.platform }}
126${{ matrix.flags }}
127--with-version-opt=${GITHUB_ACTOR}-${GITHUB_SHA}
128--with-boot-jdk=${{ steps.bootjdk.outputs.path }}
129--with-jtreg=${{ steps.jtreg.outputs.path }}
130--with-gtest=${{ steps.gtest.outputs.path }}
131--with-msvc-toolset-version=${{ inputs.msvc-toolset-version }}
132--with-jmod-compress=zip-1
133${{ inputs.extra-conf-options }} ${{ inputs.configure-arguments }} || (
134echo "Dumping config.log:" &&
135cat config.log &&
136exit 1)
137env:138# We need a minimal PATH on Windows139# Set PATH to "", so just GITHUB_PATH is included140PATH: ''141shell: env /usr/bin/bash --login -eo pipefail {0}142
143- name: 'Build'144id: build145uses: ./.github/actions/do-build146with:147make-target: '${{ inputs.make-target }} ${{ inputs.make-arguments }}'148platform: ${{ inputs.platform }}149debug-suffix: '${{ matrix.suffix }}'150
151- name: 'Upload bundles'152uses: ./.github/actions/upload-bundles153with:154platform: ${{ inputs.platform }}155debug-suffix: '${{ matrix.suffix }}'156