-
Notifications
You must be signed in to change notification settings - Fork 0
171 lines (157 loc) · 5.37 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
name: Build
on:
workflow_call:
inputs:
c2a_repo:
type: string
default: ${{ github.repository }}
federation_repos:
type: string
default: ""
c2a_dir:
type: string
default: '.'
c2a_custom_setup:
type: string
default: ''
sils_mockup:
type: boolean
default: false
# skip gcc from build to support C89-like target
skip_gcc:
type: boolean
default: false
build_msvc:
type: boolean
default: false
build_as_cxx:
type: boolean
default: false
cmake_generator_linux32:
type: string
default: 'Unix Makefiles'
cmake_generator_win32:
type: string
default: 'Visual Studio 17 2022'
cmake_flags:
type: string
default: ''
# job specific CMake flags
cmake_flags_linux32:
type: string
default: ''
cmake_flags_linux32_cxx:
type: string
default: ''
cmake_flags_win32:
type: string
default: ''
cmake_flags_win32_cxx:
type: string
default: ''
# reviewdog
reviewdog_version:
type: string
default: v0.16.0
reviewdog_default_reporter:
type: string
default: github-pr-review
reviewdog_default_filter:
type: string
default: added
secrets:
GH_FEDERATION_ENDPOINT:
required: false
env:
SELF_VERSION: v6.0.2
jobs:
build_linux32:
name: Build for linux32
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
compiler: [gcc, clang]
warning: [Werror, Wextra]
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
repository: arkedge/workflows-c2a
ref: ${{ env.SELF_VERSION }}
- name: build
if: matrix.compiler != 'gcc' || (! inputs.skip_gcc)
uses: ./action-c2a-build
env:
CC: ${{ matrix.compiler }}
with:
c2a_repo: ${{ inputs.c2a_repo }}
gh_federation_endpoint: ${{ secrets.GH_FEDERATION_ENDPOINT }}
federation_repos: ${{ inputs.federation_repos }}
c2a_dir: ${{ inputs.c2a_dir }}
c2a_custom_setup: ${{ inputs.c2a_custom_setup }}
sils_mockup: ${{ inputs.sils_mockup }}
cmake_generator: ${{ inputs.cmake_generator_linux32 }}
cmake_flags: |
${{ inputs.cmake_flags }} ${{ inputs.cmake_flags_linux32 }} \
-DADD_WEXTRA_FLAGS=${{ contains(matrix.warning, 'Wextra') }} \
-DADD_WERROR_FLAGS=${{ contains(matrix.warning, 'Werror') }}
reviewdog_version: ${{ inputs.reviewdog_version }}
reviewdog_tool_name: clang-tidy -${{ matrix.warning }}
reviewdog_reporter: ${{ (!contains(matrix.warning, 'Wextra') && inputs.reviewdog_default_reporter ) || 'github-check' }}
reviewdog_filter_mode: ${{ (!contains(matrix.warning, 'Wextra') && inputs.reviewdog_default_filter ) || 'nofilter' }}
build_linux32_cxx:
if: inputs.build_as_cxx
name: Build as C++ for linux32
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
repository: arkedge/workflows-c2a
ref: ${{ env.SELF_VERSION }}
- uses: ./action-c2a-build
with:
c2a_repo: ${{ inputs.c2a_repo }}
gh_federation_endpoint: ${{ secrets.GH_FEDERATION_ENDPOINT }}
federation_repos: ${{ inputs.federation_repos }}
c2a_dir: ${{ inputs.c2a_dir }}
c2a_custom_setup: ${{ inputs.c2a_custom_setup }}
build_as_cxx: true
cmake_generator: ${{ inputs.cmake_generator_linux32 }}
cmake_flags: ${{ inputs.cmake_flags }} ${{ inputs.cmake_flags_linux32 }}
build_win32:
if: inputs.build_msvc
name: Build for Win32 by MSVC
runs-on: windows-2022
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
repository: arkedge/workflows-c2a
ref: ${{ env.SELF_VERSION }}
- uses: ./action-c2a-build-win32
with:
c2a_repo: ${{ inputs.c2a_repo }}
gh_federation_endpoint: ${{ secrets.GH_FEDERATION_ENDPOINT }}
federation_repos: ${{ inputs.federation_repos }}
c2a_dir: ${{ inputs.c2a_dir }}
c2a_custom_setup: ${{ inputs.c2a_custom_setup }}
cmake_generator: ${{ inputs.cmake_generator_win32 }}
cmake_flags: ${{ inputs.cmake_flags }} ${{ inputs.cmake_flags_win32 }}
build_win32_cxx:
if: inputs.build_as_cxx && inputs.build_msvc
name: Build as C++ for Win32 by MSVC++
runs-on: windows-2022
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
repository: arkedge/workflows-c2a
ref: ${{ env.SELF_VERSION }}
- uses: ./action-c2a-build-win32
with:
c2a_repo: ${{ inputs.c2a_repo }}
gh_federation_endpoint: ${{ secrets.GH_FEDERATION_ENDPOINT }}
federation_repos: ${{ inputs.federation_repos }}
c2a_dir: ${{ inputs.c2a_dir }}
c2a_custom_setup: ${{ inputs.c2a_custom_setup }}
build_as_cxx: true
cmake_generator: ${{ inputs.cmake_generator_win32 }}
cmake_flags: ${{ inputs.cmake_flags }} ${{ inputs.cmake_flags_win32_cxx }}