forked from FarGroup/FarManager
-
Notifications
You must be signed in to change notification settings - Fork 0
287 lines (243 loc) · 10.1 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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
name: Build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
#------------------------------------------------------------------------------
code-style-checks:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
- name: Run checks
working-directory: far
run: python tools/source_validator.py
#------------------------------------------------------------------------------
changelog-hlf-checks:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v4
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0'
# For "--property UseSharedCompilation=false", see
# https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/troubleshooting-the-codeql-workflow#no-code-found-during-the-build
- name: Build and run ChangelogChecker
working-directory: misc/build-checks/ChangelogChecker
run: dotnet run --project ./ChangelogChecker.csproj --configuration Release --property UseSharedCompilation=false
- name: Build and run HlfChecker
working-directory: misc/build-checks/HlfChecker
run: dotnet run --project ./HlfChecker.csproj --configuration Release --property UseSharedCompilation=false -- Verbose
#------------------------------------------------------------------------------
build-msbuild:
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
build: [
msbuild_cl_x64_debug,
msbuild_cl_x64_release,
msbuild_cl_x86_debug,
msbuild_cl_x86_release,
msbuild_cl_ARM64_release,
]
include:
- { build: msbuild_cl_x64_debug, compiler: msbuild_cl, arch: amd64, platform_sln: x64, platform_name: x64, build_config: Debug }
- { build: msbuild_cl_x64_release, compiler: msbuild_cl, arch: amd64, platform_sln: x64, platform_name: x64, build_config: Release }
- { build: msbuild_cl_x86_debug, compiler: msbuild_cl, arch: amd64_x86, platform_sln: Win32, platform_name: x86, build_config: Debug }
- { build: msbuild_cl_x86_release, compiler: msbuild_cl, arch: amd64_x86, platform_sln: Win32, platform_name: x86, build_config: Release }
- { build: msbuild_cl_ARM64_release, compiler: msbuild_cl, arch: amd64_arm64, platform_sln: ARM64, platform_name: ARM64, build_config: Release }
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Initialize CodeQL
if: matrix.build == 'msbuild_cl_x64_debug'
uses: github/codeql-action/init@v2
with:
languages: cpp
- name: Set MSVC envrioment
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}
- name: Set environment for debug build
if: matrix.build_config == 'Debug'
run: Add-Content -Path $env:GITHUB_ENV -Value "DEBUG=1"
- name: Build (cl)
working-directory: _build/vc
run: msbuild -m /property:Configuration=${{ matrix.build_config }} /property:Platform=${{ matrix.platform_sln }} all.sln
- name: Perform CodeQL Analysis
if: matrix.build == 'msbuild_cl_x64_debug'
uses: github/codeql-action/analyze@v2
- name: Publish
uses: actions/upload-artifact@v3
with:
name: Far.${{ matrix.build_config }}.${{ matrix.platform_name }}
path: _build/vc/_output/product/${{ matrix.build_config }}.${{ matrix.platform_sln }}
#------------------------------------------------------------------------------
build-nmake:
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
build: [
nmake_cl_x64_debug,
nmake_cl_x64_release,
nmake_cl_x86_debug,
nmake_cl_x86_release,
nmake_cl_ARM64_release,
nmake_clang_x64_debug,
nmake_clang_x64_release,
]
include:
- { build: nmake_cl_x64_debug, compiler: nmake_cl, arch: amd64, build_config: Debug }
- { build: nmake_cl_x64_release, compiler: nmake_cl, arch: amd64, build_config: Release }
- { build: nmake_cl_x86_debug, compiler: nmake_cl, arch: amd64_x86, build_config: Debug }
- { build: nmake_cl_x86_release, compiler: nmake_cl, arch: amd64_x86, build_config: Release }
- { build: nmake_cl_ARM64_release, compiler: nmake_cl, arch: amd64_arm64, build_config: Release }
- { build: nmake_clang_x64_debug, compiler: nmake_clang, arch: amd64, build_config: Debug }
- { build: nmake_clang_x64_release, compiler: nmake_clang, arch: amd64, build_config: Release }
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Initialize CodeQL
if: matrix.build == 'nmake_cl_x64_debug'
uses: github/codeql-action/init@v2
with:
languages: cpp
- name: Set MSVC envrioment
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}
- name: Set environment for debug build
if: matrix.build_config == 'Debug'
run: Add-Content -Path $env:GITHUB_ENV -Value "DEBUG=1"
- name: Build Far (cl)
if: matrix.compiler == 'nmake_cl'
working-directory: far
run: |
cl.exe
nmake /f makefile_vc
- name: Build plugins (cl)
if: matrix.compiler == 'nmake_cl'
working-directory: plugins
run: nmake /f makefile_all_vc
- name: Build Far (clang)
if: matrix.compiler == 'nmake_clang'
working-directory: far
run: |
clang --version
nmake /f makefile_vc CLANG=1
- name: Build plugins (clang)
if: matrix.compiler == 'nmake_clang'
working-directory: plugins
run: nmake /f makefile_all_vc CLANG=1
- name: Perform CodeQL Analysis
if: matrix.build == 'nmake_cl_x64_debug'
uses: github/codeql-action/analyze@v2
#------------------------------------------------------------------------------
build-mingw:
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
build: [
mingw_gcc_x64_debug,
mingw_gcc_x64_release,
mingw_clang_x64_debug,
mingw_clang_x64_release,
mingw_llvm_x64_debug,
mingw_llvm_x64_release
]
include:
- { build: mingw_gcc_x64_debug, compiler: mingw_gcc, arch: amd64, build_config: Debug }
- { build: mingw_gcc_x64_release, compiler: mingw_gcc, arch: amd64, build_config: Release }
- { build: mingw_clang_x64_debug, compiler: mingw_clang, arch: amd64, build_config: Debug }
- { build: mingw_clang_x64_release, compiler: mingw_clang, arch: amd64, build_config: Release }
- { build: mingw_llvm_x64_debug, compiler: mingw_llvm, arch: amd64, build_config: Debug }
- { build: mingw_llvm_x64_release, compiler: mingw_llvm, arch: amd64, build_config: Release }
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Initialize CodeQL
if: matrix.build == 'mingw_gcc_x64_debug'
uses: github/codeql-action/init@v2
with:
languages: cpp
- name: Set environment for debug build
if: matrix.build_config == 'Debug'
run: |
Add-Content -Path $env:GITHUB_ENV -Value "DEBUG=1"
Add-Content -Path $env:GITHUB_ENV -Value "USE_LLD=1"
- name: Install GCC x64
if: matrix.compiler == 'mingw_gcc'
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
install: make gcc mingw-w64-x86_64-lld mingw-w64-x86_64-toolchain
- name: Build Far (gcc)
if: matrix.compiler == 'mingw_gcc'
working-directory: far
shell: msys2 {0}
run: |
gcc --version
make -j4 -f makefile_gcc
- name: Build plugins (gcc)
if: matrix.compiler == 'mingw_gcc'
working-directory: plugins
shell: msys2 {0}
run: |
gcc --version
make -j4 -f makefile_all_gcc
- name: Install Clang x64
if: matrix.compiler == 'mingw_clang'
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
install: make mingw-w64-x86_64-clang mingw-w64-x86_64-lld mingw-w64-x86_64-toolchain
- name: Build Far (clang)
if: matrix.compiler == 'mingw_clang'
working-directory: far
shell: msys2 {0}
run: |
clang --version
make -j4 CLANG=1 -f makefile_gcc
- name: Build plugins (clang)
if: matrix.compiler == 'mingw_clang'
working-directory: plugins
shell: msys2 {0}
run: |
clang --version
make -j4 CLANG=1 -f makefile_all_gcc
- name: Install llvm x64
id: install_llvm_x64
if: matrix.compiler == 'mingw_llvm'
uses: robinraju/[email protected]
with:
repository: "mstorsjo/llvm-mingw"
latest: true
fileName: "llvm-mingw-*-msvcrt-x86_64.zip"
extract: true
- name: Build Far (llvm)
if: matrix.compiler == 'mingw_llvm'
working-directory: far
shell: cmd
run: |
set path=${{github.workspace}}\llvm-mingw-${{steps.install_llvm_x64.outputs.tag_name}}-msvcrt-x86_64\bin;%path%
clang --version
make -j4 CLANG=1 -f makefile_gcc
- name: Build plugins (llvm)
if: matrix.compiler == 'mingw_llvm'
working-directory: plugins
shell: cmd
run: |
set path=${{github.workspace}}\llvm-mingw-${{steps.install_llvm_x64.outputs.tag_name}}-msvcrt-x86_64\bin;%path%
clang --version
make -j4 CLANG=1 -f makefile_all_gcc
- name: Perform CodeQL Analysis
if: matrix.build == 'mingw_gcc_x64_debug'
uses: github/codeql-action/analyze@v2