jdk

Форк
0
/
build-windows.yml 
155 строк · 5.0 Кб
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

26
name: 'Build (windows)'
27

28
on:
29
  workflow_call:
30
    inputs:
31
      platform:
32
        required: true
33
        type: string
34
      extra-conf-options:
35
        required: false
36
        type: string
37
      make-target:
38
        required: false
39
        type: string
40
        default: 'product-bundles test-bundles'
41
      debug-levels:
42
        required: false
43
        type: string
44
        default: '[ "debug", "release" ]'
45
      msvc-toolset-version:
46
        required: true
47
        type: string
48
      msvc-toolset-architecture:
49
        required: true
50
        type: string
51
      configure-arguments:
52
        required: false
53
        type: string
54
      make-arguments:
55
        required: false
56
        type: string
57

58
env:
59
  # These are needed to make the MSYS2 bash work properly
60
  MSYS2_PATH_TYPE: minimal
61
  CHERE_INVOKING: 1
62

63
jobs:
64
  build-windows:
65
    name: build
66
    runs-on: windows-2019
67
    defaults:
68
      run:
69
        shell: bash
70

71
    strategy:
72
      fail-fast: false
73
      matrix:
74
        debug-level: ${{ fromJSON(inputs.debug-levels) }}
75
        include:
76
          - debug-level: debug
77
            flags: --with-debug-level=fastdebug
78
            suffix: -debug
79

80
    steps:
81
      - name: 'Checkout the JDK source'
82
        uses: actions/checkout@v4
83

84
      - name: 'Get MSYS2'
85
        uses: ./.github/actions/get-msys2
86

87
      - name: 'Get the BootJDK'
88
        id: bootjdk
89
        uses: ./.github/actions/get-bootjdk
90
        with:
91
          platform: windows-x64
92

93
      - name: 'Get JTReg'
94
        id: jtreg
95
        uses: ./.github/actions/get-jtreg
96

97
      - name: 'Get GTest'
98
        id: gtest
99
        uses: ./.github/actions/get-gtest
100

101
      - name: 'Check toolchain installed'
102
        id: toolchain-check
103
        run: |
104
          set +e
105
          '/c/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/vc/auxiliary/build/vcvars64.bat' -vcvars_ver=${{ inputs.msvc-toolset-version }}
106
          if [ $? -eq 0 ]; then
107
            echo "Toolchain is already installed"
108
            echo "toolchain-installed=true" >> $GITHUB_OUTPUT
109
          else
110
            echo "Toolchain is not yet installed"
111
            echo "toolchain-installed=false" >> $GITHUB_OUTPUT
112
          fi
113

114
      - name: 'Install toolchain and dependencies'
115
        run: |
116
          # Run Visual Studio Installer
117
          '/c/Program Files (x86)/Microsoft Visual Studio/Installer/vs_installer.exe' \
118
            modify --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 }}
120
        if: steps.toolchain-check.outputs.toolchain-installed != 'true'
121

122
      - name: 'Configure'
123
        run: >
124
          bash 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 }} || (
134
          echo "Dumping config.log:" &&
135
          cat config.log &&
136
          exit 1)
137
        env:
138
          # We need a minimal PATH on Windows
139
          # Set PATH to "", so just GITHUB_PATH is included
140
          PATH: ''
141
        shell: env /usr/bin/bash --login -eo pipefail {0}
142

143
      - name: 'Build'
144
        id: build
145
        uses: ./.github/actions/do-build
146
        with:
147
          make-target: '${{ inputs.make-target }} ${{ inputs.make-arguments }}'
148
          platform: ${{ inputs.platform }}
149
          debug-suffix: '${{ matrix.suffix }}'
150

151
      - name: 'Upload bundles'
152
        uses: ./.github/actions/upload-bundles
153
        with:
154
          platform: ${{ inputs.platform }}
155
          debug-suffix: '${{ matrix.suffix }}'
156

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.