jdk

Форк
0
/
build-linux.yml 
145 строк · 4.9 Кб
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 (linux)'
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
      gcc-major-version:
46
        required: true
47
        type: string
48
      gcc-package-suffix:
49
        required: false
50
        type: string
51
        default: ''
52
      apt-architecture:
53
        required: false
54
        type: string
55
      apt-extra-packages:
56
        required: false
57
        type: string
58
      configure-arguments:
59
        required: false
60
        type: string
61
      make-arguments:
62
        required: false
63
        type: string
64

65
jobs:
66
  build-linux:
67
    name: build
68
    runs-on: ubuntu-22.04
69

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

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

83
      - name: 'Get the BootJDK'
84
        id: bootjdk
85
        uses: ./.github/actions/get-bootjdk
86
        with:
87
          platform: linux-x64
88

89
      - name: 'Get JTReg'
90
        id: jtreg
91
        uses: ./.github/actions/get-jtreg
92

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

97
      - name: 'Set architecture'
98
        id: arch
99
        run: |
100
          # Set a proper suffix for packages if using a different architecture
101
          if [[ '${{ inputs.apt-architecture }}' != '' ]]; then
102
            echo 'suffix=:${{ inputs.apt-architecture }}' >> $GITHUB_OUTPUT
103
          fi
104

105
      # Upgrading apt to solve libc6 installation bugs, see JDK-8260460.
106
      - name: 'Install toolchain and dependencies'
107
        run: |
108
          # Install dependencies using apt-get
109
          if [[ '${{ inputs.apt-architecture }}' != '' ]]; then
110
            sudo dpkg --add-architecture ${{ inputs.apt-architecture }}
111
          fi
112
          sudo apt-get update
113
          sudo apt-get install --only-upgrade apt
114
          sudo apt-get install gcc-${{ inputs.gcc-major-version }}${{ inputs.gcc-package-suffix }} g++-${{ inputs.gcc-major-version }}${{ inputs.gcc-package-suffix }} libxrandr-dev${{ steps.arch.outputs.suffix }} libxtst-dev${{ steps.arch.outputs.suffix }} libcups2-dev${{ steps.arch.outputs.suffix }} libasound2-dev${{ steps.arch.outputs.suffix }} ${{ inputs.apt-extra-packages }}
115
          sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{ inputs.gcc-major-version }} 100 --slave /usr/bin/g++ g++ /usr/bin/g++-${{ inputs.gcc-major-version }}
116

117
      - name: 'Configure'
118
        run: >
119
          bash configure
120
          --with-conf-name=${{ inputs.platform }}
121
          ${{ matrix.flags }}
122
          --with-version-opt=${GITHUB_ACTOR}-${GITHUB_SHA}
123
          --with-boot-jdk=${{ steps.bootjdk.outputs.path }}
124
          --with-jtreg=${{ steps.jtreg.outputs.path }}
125
          --with-gtest=${{ steps.gtest.outputs.path }}
126
          --with-zlib=system
127
          --with-jmod-compress=zip-1
128
          ${{ inputs.extra-conf-options }} ${{ inputs.configure-arguments }} || (
129
          echo "Dumping config.log:" &&
130
          cat config.log &&
131
          exit 1)
132

133
      - name: 'Build'
134
        id: build
135
        uses: ./.github/actions/do-build
136
        with:
137
          make-target: '${{ inputs.make-target }} ${{ inputs.make-arguments }}'
138
          platform: ${{ inputs.platform }}
139
          debug-suffix: '${{ matrix.suffix }}'
140

141
      - name: 'Upload bundles'
142
        uses: ./.github/actions/upload-bundles
143
        with:
144
          platform: ${{ inputs.platform }}
145
          debug-suffix: '${{ matrix.suffix }}'
146

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

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

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

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