-
Notifications
You must be signed in to change notification settings - Fork 7
526 lines (460 loc) · 19.1 KB
/
blank.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
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
# This is a basic workflow to help you get started with Actions
name: Hajime Builds
## Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
#workflow_dispatch:
## A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# # This workflow contains a single job called "build"
build-linux-amd64:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Run a multi-line script
run: |
sudo apt update
sudo apt install -y g++-12 libfmt-dev libboost-all-dev libsensors-dev
cmake source -D CMAKE_CXX_COMPILER=g++-12
cmake --build . -j 4
- uses: actions/upload-artifact@v3
with:
name: hajime-linux-amd64
path: hajime
build-linux-amd64-avx512:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Run a multi-line script
run: |
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install -y g++-12 libboost-all-dev libfmt-dev libsensors-dev
cmake source -DADD_FLAGS="-march=x86-64-v4" -DCMAKE_CXX_COMPILER=g++-12
cmake --build . -j 2
- uses: actions/upload-artifact@v3
with:
name: hajime-linux-amd64-avx512
path: hajime
build-macos-amd64:
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- name: Run a multi-line script
run: |
brew install boost fmt libssh ncurses openssl
export PKG_CONFIG_PATH="/usr/local/opt/openssl@3/lib/pkgconfig"
cmake source
cmake --build . -j 4
- uses: actions/upload-artifact@v3
with:
name: hajime-macos-amd64
path: hajime
build-macos-arm64:
runs-on: [self-hosted, macos]
steps:
- uses: actions/checkout@v3
- name: Run a multi-line script
run: |
brew install boost fmt libssh ncurses openssl
brew link --force openssl
cmake source
cmake --build . -j 4
- uses: actions/upload-artifact@v3
with:
name: hajime-macos-arm64
path: hajime
build-linux-arm64:
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
- name: Run a multi-line script
run: |
sudo apt update
sudo apt install -y g++-12 libfmt-dev libboost-all-dev libsensors-dev libz-dev
cmake source -D CMAKE_CXX_COMPILER=g++-12
cmake --build . -j 4
- uses: actions/upload-artifact@v3
with:
name: hajime-linux-arm64
path: hajime
## build-linux-riscv64:
## runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Run a multi-line script
# run: |
# sudo apt update
# sudo apt install g++-10-riscv64-linux-gnu
# cmake source -D CMAKE_CXX_COMPILER=riscv64-linux-gnu-g++-10
# cmake --build . -j 8
# - uses: actions/upload-artifact@v3
# with:
# name: hajime-linux-riscv64
# path: hajime
# build-linux-ppc64le:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Run a multi-line script
# run: |
# sudo apt update
# sudo apt install g++-10-powerpc64le-linux-gnu
# cmake source -D CMAKE_CXX_COMPILER=powerpc64le-linux-gnu-g++-10
# cmake --build . -j 8
# - uses: actions/upload-artifact@v3
# with:
# name: hajime-linux-ppc64le
# path: hajime
# build-linux-sparc64:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Run a multi-line script
# run: |
# sudo apt update
# sudo apt install g++-10-sparc64-linux-gnu
# cmake source -D CMAKE_CXX_COMPILER=sparc64-linux-gnu-g++-10
# cmake --build . -j 8
# - uses: actions/upload-artifact@v3
# with:
# name: hajime-linux-sparc64
# path: hajime
# build-linux-arm32hf:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Run a multi-line script
# run: |
# sudo apt-get update
# sudo apt-get install -y g++-10-arm-linux-gnueabihf
# cmake source -D CMAKE_CXX_COMPILER=arm-linux-gnueabihf-g++-10
# cmake --build . -j 8
# - uses: actions/upload-artifact@v3
# with:
# name: hajime-linux-arm32hf
# path: hajime
# build-linux-alpha:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Run a multi-line script
# run: |
# sudo apt update
# sudo apt install g++-10-alpha-linux-gnu
# cmake source -D CMAKE_CXX_COMPILER=alpha-linux-gnu-g++-10
# cmake --build . -j 8
# - uses: actions/upload-artifact@v3
# with:
# name: hajime-linux-alpha
# path: hajime
# build-linux-hppa:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Run a multi-line script
# run: |
# sudo apt update
# sudo apt install g++-10-hppa-linux-gnu
# cmake source -D CMAKE_CXX_COMPILER=hppa-linux-gnu-g++-10
# cmake --build . -j 8
# - uses: actions/upload-artifact@v3
# with:
# name: hajime-linux-hppa
# path: hajime
# build-linux-ppc64:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Run a multi-line script
# run: |
# sudo apt update
# sudo apt install g++-10-powerpc64-linux-gnu
# cmake source -D CMAKE_CXX_COMPILER=powerpc64-linux-gnu-g++-10
# cmake --build . -j 8
# - uses: actions/upload-artifact@v3
# with:
# name: hajime-linux-ppc64
# path: hajime
# build-linux-s390x:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Run a multi-line script
# run: |
# sudo apt update
# sudo apt install g++-10-s390x-linux-gnu
# cmake source -D CMAKE_CXX_COMPILER=s390x-linux-gnu-g++-10
# cmake --build . -j 8
# - uses: actions/upload-artifact@v3
# with:
# name: hajime-linux-s390x
# path: hajime
build-windows-amd64:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Run a multi-line script
run: |
vcpkg install fmt:x64-mingw-static boost-algorithm:x64-mingw-static zlib:x64-mingw-static openssl:x64-mingw-static
vcpkg integrate install
cmake source -G "MinGW Makefiles" -D CMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-mingw-static -DADD_FLAGS="-static"
cmake --build . -j 4
- uses: actions/upload-artifact@v3
with:
name: hajime-windows-amd64
path: hajime.exe
# build-windows-x86:
# runs-on: windows-latest
# steps:
# - uses: actions/checkout@v3
# - name: Run a multi-line script
# run: |
# cmake source -A Win32
# cmake --build . -j 8 --config Release
# - uses: actions/upload-artifact@v3
# with:
# name: hajime-windows-x86
# path: Release\hajime.exe
# build-windows-arm32:
# runs-on: windows-latest
# steps:
# - uses: actions/checkout@v3
# - name: Run a multi-line script
# run: |
# cmake source -A ARM
# cmake --build . -j 8 --config Release
# - uses: actions/upload-artifact@v3
# with:
# name: hajime-windows-arm32
# path: Release\hajime.exe
# build-windows-arm64:
# runs-on: windows-latest
# steps:
# - uses: actions/checkout@v3
# - name: Run a multi-line script
# run: |
# cmake source -A ARM64
# cmake --build . -j 8 --config Release
# - uses: actions/upload-artifact@v3
# with:
# name: hajime-windows-arm64
# path: Release\hajime.exe
# build-freebsd-amd64:
# runs-on: ubuntu-22.04
#
# steps:
# - uses: actions/checkout@v3
# with:
# submodules: recursive
#
# - name: Run a multi-line script
# run: |
# mkdir temp
# curl -L -o fbsd_temp.iso https://download.freebsd.org/ftp/releases/amd64/amd64/ISO-IMAGES/13.1/FreeBSD-13.0-RELEASE-amd64-dvd1.iso
# sudo mount -o loop -t iso9660 fbsd_temp.iso temp
# sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
# sudo apt update
# sudo apt install -y clang-14
# wget https://boostorg.jfrog.io/artifactory/main/release/1.80.0/source/boost_1_80_0.tar.gz
# tar -xf boost_1_80_0.tar.gz
# wget https://github.com/fmtlib/fmt/releases/download/9.1.0/fmt-9.1.0.zip
# unzip fmt-9.1.0.zip
# cmake -DCMAKE_SYSTEM_NAME="FreeBSD" -DNO_SSL=1 -DADD_FLAGS="-target x86_64-unknown-freebsd13.0 --sysroot=temp/ -lncursesw" -DCMAKE_CXX_COMPILER=clang++-14 source
# cmake --build . -j 4
#
# - uses: actions/upload-artifact@v3
# with:
# name: hajime-freebsd-amd64
# path: hajime
# build-freebsd-amd64-avx2:
# runs-on: ubuntu-22.04
#
# steps:
# - uses: actions/checkout@v3
# with:
# submodules: recursive
#
# - name: Run a multi-line script
# run: |
# mkdir temp
# curl -L -o fbsd_temp.iso https://download.freebsd.org/ftp/releases/amd64/amd64/ISO-IMAGES/13.1/FreeBSD-13.1-RELEASE-amd64-dvd1.iso
# sudo mount -o loop -t iso9660 fbsd_temp.iso temp
# sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
# sudo apt update
# sudo apt install -y clang-14
# cmake -DCMAKE_SYSTEM_NAME="FreeBSD" -DNO_SSL=1 -DADD_FLAGS="-target x86_64-unknown-freebsd13.0 --sysroot=temp/ -lncursesw -march=x86-64-v3" -DCMAKE_CXX_COMPILER=clang++-14 source
# cmake --build . -j 4
#
# - uses: actions/upload-artifact@v3
# with:
# name: hajime-freebsd-amd64-avx2
# path: hajime
# build-freebsd-amd64-avx512:
# runs-on: ubuntu-22.04
#
# steps:
# - uses: actions/checkout@v3
# with:
# submodules: recursive
#
# - name: Run a multi-line script
# run: |
# mkdir temp
# curl -L -o fbsd_temp.iso https://download.freebsd.org/ftp/releases/amd64/amd64/ISO-IMAGES/13.1/FreeBSD-13.1-RELEASE-amd64-dvd1.iso
# sudo mount -o loop -t iso9660 fbsd_temp.iso temp
# sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
# sudo apt update
# sudo apt install -y clang-14
# cmake -DCMAKE_SYSTEM_NAME="FreeBSD" -DNO_SSL=1 -DADD_FLAGS="-target x86_64-unknown-freebsd13.0 --sysroot=temp/ -lncursesw -march=x86-64-v4" -DCMAKE_CXX_COMPILER=clang++-14 source
# cmake --build . -j 4
#
# - uses: actions/upload-artifact@v3
# with:
# name: hajime-freebsd-amd64-avx512
# path: hajime
# build-freebsd-arm64:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Run a multi-line script
# run: |
# sudo apt update
# sudo apt install -y qemu-user g++-10-aarch64-linux-gnu
# wget https://zlib.net/zlib-1.2.11.tar.gz
# tar -xvf zlib-1.2.11.tar.gz
# cd zlib-1.2.11/
# CC="aarch64-linux-gnu-gcc-10" LDSHARED="aarch64-linux-gnu-gcc-10 -shared" ./configure --prefix=/usr/aarch64-linux-gnu
# make -j 2
# sudo make install
# cd ../
# wget https://invisible-mirror.net/archives/ncurses/ncurses-6.3.tar.gz
# tar -xvf ncurses-6.3.tar.gz
# cd ncurses-6.3/
# CC="aarch64-linux-gnu-gcc-10" LDSHARED="aarch64-linux-gnu-gcc-10 -shared" ./configure --prefix=/usr/aarch64-linux-gnu --build x86_64-linux-gnu --host aarch64-linux-gnu --with-shared
# make -j 2
# sudo make --ignore-errors install
# sudo ln -s /usr/aarch64-linux-gnu/lib/libncurses.so.6 /usr/aarch64-linux-gnu/lib/libtinfo.so.5
# cd ../
# wget https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.1/clang+llvm-12.0.1-aarch64-linux-gnu.tar.xz
# tar -xvf clang+llvm-12.0.1-aarch64-linux-gnu.tar.xz
# echo "qemu-aarch64 -L /usr/aarch64-linux-gnu $(realpath clang+llvm-12.0.1-aarch64-linux-gnu/bin/ld).lld -v -L$(realpath fbsd/) -nostdlib -lc++ \"\$@\" -nostdlib -lc++ -lpthread -lm" > dummylld.sh
# chmod +x dummylld.sh
# echo "qemu-aarch64 -L /usr/aarch64-linux-gnu $(realpath clang+llvm-12.0.1-aarch64-linux-gnu/bin/clang-12) -v \"\$@\" -I$(realpath fbsd)/" > dummyclang.sh
# chmod +x dummyclang.sh
# echo "#include <string>
# #include <iostream>
# int main(int argc, char *argv[]) { std::string flags; if (argc > 1) { for (int i = 1; i < argc; i++) { flags += std::string(argv[i]) + ' ';}} flags = \"bash dummylld.sh \" + flags; system(flags.c_str());}" > dummylld.cpp
# g++ -o dummylld dummylld.cpp
# mkdir fbsd
# curl -L -o fbsd_temp.iso https://download.freebsd.org/releases/arm64/aarch64/ISO-IMAGES/13.0/FreeBSD-13.0-RELEASE-arm64-aarch64-dvd1.iso
# sudo mount -o loop,ro -t iso9660 fbsd_temp.iso fbsd
# VERBOSE=1 cmake -DCMAKE_CXX_COMPILER="$(realpath dummyclang.sh)" -DCMAKE_C_COMPILER="$(realpath dummyclang.sh)" -DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=$(realpath dummylld)" -DADD_FLAGS="-target aarch64-pc-freebsd13.0 --sysroot=$(realpath fbsd)/" source
# VERBOSE=1 cmake --build . -j 2
# - uses: actions/upload-artifact@v3
# with:
# name: hajime-freebsd-arm64
# path: hajime
# build-freebsd-ppc64le:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Run a multi-line script
# run: |
# sudo apt update #Update our cache for packages.
# sudo apt install -y qemu-user g++-10-powerpc64le-linux-gnu #Install the emulator, and a cross-compiler to get libraries for the emulator and compile the libraries.
# wget https://zlib.net/zlib-1.2.11.tar.gz #Clang needs this to start, although we won't need it to compile
# tar -xvf zlib-1.2.11.tar.gz
# cd zlib-1.2.11/
# CC="powerpc64le-linux-gnu-gcc-10" LDSHARED="powerpc64le-linux-gnu-gcc-10 -shared" ./configure --prefix=/usr/powerpc64le-linux-gnu #Specify the cross-compiler we want
# make -j 2
# sudo make install
# cd ../
# wget https://invisible-mirror.net/archives/ncurses/ncurses-6.3.tar.gz #Clang also needs this to start, although we won't need it for compiling either
# tar -xvf ncurses-6.3.tar.gz
# cd ncurses-6.3/
# CC="powerpc64le-linux-gnu-gcc-10" LDSHARED="powerpc64le-linux-gnu-gcc-10 -shared" ./configure --prefix=/usr/powerpc64le-linux-gnu --build x86_64-linux-gnu --host powerpc64le-linux-gnu --with-shared #Ncurses needs more configuration to cross-compile; build is what we're building on, target is what it will run on
# make -j 2
# sudo make --ignore-errors install #In GHA, Ncurses gives an error about the tic program, but we don't need it, so ignore the error
# sudo ln -s /usr/powerpc64le-linux-gnu/lib/libncurses.so.6 /usr/powerpc64le-linux-gnu/lib/libtinfo.so.5 #Clang needs libtinfo.so.5 to start, but this is not compiled by default, but it is included in libncurses.
# cd ../
# wget https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.1/clang+llvm-12.0.1-powerpc64le-linux-ubuntu-18.04.tar.xz #Download the compiler we need
# tar -xvf clang+llvm-12.0.1-powerpc64le-linux-ubuntu-18.04.tar.xz
# echo "qemu-ppc64le -L /usr/powerpc64le-linux-gnu $(realpath clang+llvm-12.0.1-powerpc64le-linux-ubuntu-18.04/bin/ld).lld -v -L$(realpath fbsd/) -nostdlib -lc++ \"\$@\" -nostdlib -lc++ -lpthread -lm" > dummylld.sh #This is a dummy program that wraps QEMU and the linker because CMake requires there to be no spaces
# chmod +x dummylld.sh #CMake needs this to run the script
# echo "qemu-ppc64le -L /usr/powerpc64le-linux-gnu $(realpath clang+llvm-12.0.1-powerpc64le-linux-ubuntu-18.04/bin/clang-12) -v \"\$@\" -I$(realpath fbsd)/" > dummyclang.sh
# chmod +x dummyclang.sh
# echo "#include <string>
# #include <iostream>
# int main(int argc, char *argv[]) { std::string flags; if (argc > 1) { for (int i = 1; i < argc; i++) { flags += std::string(argv[i]) + ' ';}} flags = \"bash dummylld.sh \" + flags; system(flags.c_str());}" > dummylld.cpp #This is a wrapper for the dummylld.sh wrapper because CMake cannot execute shell scripts natively
# g++ -o dummylld dummylld.cpp
# mkdir fbsd
# curl -L -o fbsd_temp.iso https://download.freebsd.org/releases/powerpc/powerpc64le/ISO-IMAGES/13.0/FreeBSD-13.0-RELEASE-powerpc-powerpc64le-dvd1.iso
# sudo mount -o loop,ro -t iso9660 fbsd_temp.iso fbsd #Don't extract, but mount
# VERBOSE=1 cmake -DCMAKE_CXX_COMPILER="$(realpath dummyclang.sh)" -DCMAKE_C_COMPILER="$(realpath dummyclang.sh)" -DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=$(realpath dummylld)" -DADD_FLAGS="-target powerpc64le-pc-freebsd13.0 --sysroot=$(realpath fbsd)/" source
# VERBOSE=1 cmake --build . -j 18
# - uses: actions/upload-artifact@v3
# with:
# name: hajime-freebsd-ppc64le
# path: hajime
# build-linux-arm32l:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Run a multi-line script
# run: |
# sudo apt-get update
# sudo apt-get install -y g++-10-arm-linux-gnueabi
# cmake source -D CMAKE_CXX_COMPILER=arm-linux-gnueabi-g++-10
# cmake --build . -j 10
# - uses: actions/upload-artifact@v3
# with:
# name: hajime-linux-arm32l
# path: hajime
# build-linux-sh4:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Run a multi-line script
# run: |
# sudo apt update
# sudo apt install g++-10-sh4-linux-gnu
# cmake source -D CMAKE_CXX_COMPILER=sh4-linux-gnu-g++-10
# cmake --build . -j 8
# - uses: actions/upload-artifact@v3
# with:
# name: hajime-linux-sh4
# path: hajime
# build-linux-m68k:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Run a multi-line script
# run: |
# sudo apt update
# sudo apt install g++-10-m68k-linux-gnu
# cmake source -D CMAKE_CXX_COMPILER=m68k-linux-gnu-g++-10
# cmake --build . -j 8
# - uses: actions/upload-artifact@v3
# with:
# name: hajime-linux-m68k
# path: hajime
# build-linux-ppc:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Run a multi-line script
# run: |
# sudo apt update
# sudo apt install g++-10-powerpc-linux-gnu
# cmake source -D CMAKE_CXX_COMPILER=powerpc-linux-gnu-g++-10
# cmake --build . -j 8
# - uses: actions/upload-artifact@v3
# with:
# name: hajime-linux-ppc
# path: hajime