-
Notifications
You must be signed in to change notification settings - Fork 38
172 lines (140 loc) · 5.77 KB
/
build.yml
File metadata and controls
172 lines (140 loc) · 5.77 KB
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
name: Build and test
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
jobs:
build-linux-amd64:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up CMake
uses: jwlawson/actions-setup-cmake@v2
- name: Build PC (Linux)
run: |
cmake -S ${{github.workspace}} -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release
cmake --build ${{github.workspace}}/build
- name: Tar files
run: tar -cvf build-pc.tar .
- name: Upload Artifact
uses: actions/upload-artifact@v6
with:
name: build-PC-artifacts
path: build-pc.tar
build-windows:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up CMake
uses: jwlawson/actions-setup-cmake@v2
- name: Install Windows toolchain
run: |
sudo apt-get update
sudo apt-get install -y mingw-w64 mingw-w64-tools
- name: Build (crosscompile) PC Windows
run: |
cmake -S ${{github.workspace}} -B ${{github.workspace}}/build-windows -DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/windows_x86_64_toolchain.cmake -DCMAKE_BUILD_TYPE=Release
cmake --build ${{github.workspace}}/build-windows
build-linux-arm64:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up CMake
uses: jwlawson/actions-setup-cmake@v2
- name: Install ARM toolchain
run: |
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu
- name: Build (crosscompile) PC Linux ARM64
run: |
cmake -S ${{github.workspace}} -B ${{github.workspace}}/build-arm -DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/arm64_toolchain.cmake -DCMAKE_BUILD_TYPE=Release
cmake --build ${{github.workspace}}/build-arm
build-linux-s390x:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up CMake
uses: jwlawson/actions-setup-cmake@v2
- name: Install s390x toolchain
run: |
sudo apt-get update
sudo apt-get install -y gcc-s390x-linux-gnu g++-s390x-linux-gnu binutils-s390x-linux-gnu libc6-s390x-cross
- name: Build (crosscompile) PC Linux s390x
run: |
cmake -S ${{github.workspace}} -B ${{github.workspace}}/build-s390x -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=s390x -DCMAKE_C_COMPILER=s390x-linux-gnu-gcc -DCMAKE_CXX_COMPILER=s390x-linux-gnu-g++ -DCMAKE_BUILD_TYPE=Release
cmake --build ${{github.workspace}}/build-s390x
build-darwin-arm64:
runs-on: macos-latest
steps:
- uses: actions/checkout@v6
- name: Build macOS ARM64 (Apple Silicon)
run: |
cmake -S ${{github.workspace}} -B ${{github.workspace}}/build-darwin -DUNIVERSAL=FALSE -DCMAKE_OSX_ARCHITECTURES=arm64 -DARM=1 -DCMAKE_BUILD_TYPE=Release
cmake --build ${{github.workspace}}/build-darwin
build-darwin-universal:
runs-on: macos-latest
steps:
- uses: actions/checkout@v6
- name: Build macOS Universal (ARM64 + AMD64)
run: |
cmake -S ${{github.workspace}} -B ${{github.workspace}}/build -DCMAKE_TOOLCHAIN_FILE=macos_universal_toolchain.cmake -DUNIVERSAL=1 -DCMAKE_BUILD_TYPE=Release
cmake --build ${{github.workspace}}/build
test-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up CMake
uses: jwlawson/actions-setup-cmake@v2
- name: Build PC (Linux) for coverage
run: |
cmake -S ${{github.workspace}} -B ${{github.workspace}}/build -DENABLE_COVERAGE=ON
cmake --build ${{github.workspace}}/build
- name: Run tests for PC
run: |
cd build
ctest
- name: Generate coverage report
run: |
sudo apt-get update
sudo apt-get install -y lcov
lcov --capture --directory ${{github.workspace}}/build --output-file ${{github.workspace}}/build/coverage.info
lcov --remove ${{github.workspace}}/build/coverage.info '/usr/*' --output-file ${{github.workspace}}/build/coverage.info
lcov --list ${{github.workspace}}/build/coverage.info
- name: Upload coverage report
uses: actions/upload-artifact@v6
with:
name: coverage-report
path: ${{github.workspace}}/build/coverage.info
- name: Upload test results
uses: actions/upload-artifact@v6
with:
name: LastTest.log
path: ${{github.workspace}}/build/Testing/Temporary/LastTest.log
test-linux-s390x:
runs-on: ubuntu-latest
env:
QEMU_LD_PREFIX: /usr/s390x-linux-gnu
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up CMake
uses: jwlawson/actions-setup-cmake@v2
- name: Install s390x toolchain and emulator
run: |
sudo apt-get update
sudo apt-get install -y gcc-s390x-linux-gnu g++-s390x-linux-gnu binutils-s390x-linux-gnu libc6-s390x-cross qemu-user qemu-user-static
- name: Build (crosscompile) PC Linux s390x for tests
run: |
cmake -S ${{github.workspace}} -B ${{github.workspace}}/build-s390x -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=s390x -DCMAKE_C_COMPILER=s390x-linux-gnu-gcc -DCMAKE_CXX_COMPILER=s390x-linux-gnu-g++ -DCMAKE_BUILD_TYPE=Release -DCMAKE_CROSSCOMPILING_EMULATOR="qemu-s390x;-L;/usr/s390x-linux-gnu"
cmake --build ${{github.workspace}}/build-s390x
- name: Run tests for s390x
run: |
cd build-s390x
ctest --output-on-failure --timeout 15