-
Notifications
You must be signed in to change notification settings - Fork 47
224 lines (200 loc) · 7.73 KB
/
linux-build-test.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
name: Linux build and test
on:
push:
paths-ignore:
- "docs/**"
- "docker/**"
pull_request:
paths-ignore:
- "docs/**"
- "docker/**"
jobs:
test-arm:
timeout-minutes: 30
runs-on: [ self-hosted, ARM64 ] # self-hosted, using Oracle free tier instance
steps:
- uses: actions/checkout@v4
- name: Prepare environment
run: |
sudo apt-get update -y
sudo apt-get install -y \
g++ \
cmake \
ninja-build \
libboost-locale-dev libboost-thread-dev libboost-filesystem-dev libboost-log-dev libboost-stacktrace-dev libboost-container-dev \
libssl-dev \
libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \
libwayland-dev wayland-protocols libinput-dev libxkbcommon-dev libgbm-dev \
libcurl4-openssl-dev \
libpulse-dev \
libevdev-dev \
libudev-dev \
libdrm-dev \
libpci-dev \
libunwind-dev
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Setup gst-wayland-display
run: |
git clone https://github.com/games-on-whales/gst-wayland-display
cd gst-wayland-display
git checkout a31f5a0
cargo install cargo-c
cargo cinstall -p c-bindings --prefix=/usr/local
- name: Archive libgstwaylanddisplay-aarch64
uses: actions/upload-artifact@v4
with:
name: libgstwaylanddisplay-aarch64
path: |
/usr/local/lib/aarch64-linux-gnu/liblibgstwaylanddisplay*
/usr/local/lib/aarch64-linux-gnu/pkgconfig/
/usr/local/include/libgstwaylanddisplay/*
if-no-files-found: error
- name: Configure build
working-directory: ${{runner.workspace}}
run: |
cmake -Bbuild \
-H$GITHUB_WORKSPACE \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_EXTENSIONS=OFF \
-DTEST_VIRTUAL_INPUT=OFF \
-DTEST_DOCKER=ON \
-DTEST_RUST_WAYLAND=ON \
-DTEST_NVIDIA=OFF \
-DTEST_EXCEPTIONS=OFF \
-DTEST_UHID=OFF \
-G Ninja
- name: Build tests + lib
working-directory: ${{runner.workspace}}/build
run: ninja -j $(nproc) wolftests
- name: Run tests
working-directory: ${{runner.workspace}}/build/tests
env:
RUST_BACKTRACE: FULL
RUST_LOG: FATAL
XDG_RUNTIME_DIR: /tmp
HOST_APPS_STATE_FOLDER: ${{runner.workspace}}
run: ./wolftests --reporter JUnit::out=${{runner.workspace}}/report.xml --reporter console::out=-::colour-mode=ansi
- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure() # run this step even if previous step failed
with:
name: aarch64
path: ${{runner.workspace}}/report.xml
reporter: java-junit
# First build the common dependencies: Rust-based libgstwaylanddisplay
build-gst-wayland:
runs-on: ubuntu-24.04
steps:
- name: Prepare environment
# ubuntu-latest breaks without libunwind-dev,
# see: https://github.com/actions/runner-images/issues/6399#issuecomment-1286050292
run: |
sudo apt-get update -y
sudo apt-get install -y libunwind-dev
sudo apt-get install -y \
libwayland-dev libwayland-server0 libinput-dev libxkbcommon-dev libgbm-dev \
libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Setup gst-wayland-display
run: |
git clone https://github.com/games-on-whales/gst-wayland-display
cd gst-wayland-display
git checkout a31f5a0
cargo install cargo-c
cargo cinstall -p c-bindings --prefix=/usr/local --destdir=${{runner.workspace}}
- name: Archive libgstwaylanddisplay-x86_64
uses: actions/upload-artifact@v4
with:
name: libgstwaylanddisplay-x86_64
path: |
${{runner.workspace}}/usr/local/lib/x86_64-linux-gnu/liblibgstwaylanddisplay*
${{runner.workspace}}/usr/local/lib/x86_64-linux-gnu/pkgconfig/
${{runner.workspace}}/usr/local/include/libgstwaylanddisplay/*
if-no-files-found: error
test:
runs-on: ubuntu-24.04
needs: build-gst-wayland
strategy:
fail-fast: false
matrix:
cxx:
- g++-12
- clang++-16
build_type: [ Release ]
shared: [ true, false ]
std: [ 20 ]
include:
- cxx: g++-12
other_pkgs: [ g++-12 ]
- cxx: clang++-16
other_pkgs: [ clang-16 ]
steps:
- uses: actions/checkout@v4
- name: Download pre-built libgstwaylanddisplay-x86_64
uses: actions/download-artifact@v4
with:
name: libgstwaylanddisplay-x86_64
path: ${{runner.workspace}}/libgstwaylanddisplay
- name: Move the library in the right place
run: |
ls -R ${{runner.workspace}}/libgstwaylanddisplay
sudo cp -rn ${{runner.workspace}}/libgstwaylanddisplay/* /usr/local/
- name: Prepare environment
# ubuntu-latest breaks without libunwind-dev,
# see: https://github.com/actions/runner-images/issues/6399#issuecomment-1286050292
run: |
sudo apt-get update -y
sudo apt-get install -y libunwind-dev
sudo apt-get install -y \
ninja-build \
libboost-locale-dev libboost-thread-dev libboost-filesystem-dev libboost-log-dev libboost-stacktrace-dev libboost-container-dev \
libssl-dev \
libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \
libwayland-dev libwayland-server0 libinput-dev libxkbcommon-dev libgbm-dev \
libcurl4-openssl-dev \
libpulse-dev \
libevdev-dev \
libudev-dev \
libdrm-dev \
libpci-dev \
libunwind-dev \
${{ join(matrix.other_pkgs, ' ') }}
- name: Configure build
working-directory: ${{runner.workspace}}
env:
CXX: ${{matrix.cxx}}
CXXFLAGS: ${{matrix.cxxflags}}
# Note: $GITHUB_WORKSPACE is distinct from ${{runner.workspace}}.
# This is important
run: |
cmake -Bbuild \
-H$GITHUB_WORKSPACE \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_CXX_STANDARD=${{ matrix.std }} \
-DCMAKE_CXX_EXTENSIONS=OFF \
-DBUILD_SHARED_LIBS=${{ matrix.shared }} \
-DCATCH_DEVELOPMENT_BUILD=ON \
-DTEST_VIRTUAL_INPUT=OFF \
-DTEST_DOCKER=OFF \
-DLINK_RUST_WAYLAND=ON \
-DTEST_RUST_WAYLAND=OFF \
-DTEST_NVIDIA=OFF \
-DTEST_SDL=OFF \
-G Ninja
- name: Build tests + lib
working-directory: ${{runner.workspace}}/build
run: ninja -j $(nproc) wolftests
- name: Run tests
working-directory: ${{runner.workspace}}/build/tests
env:
HOST_APPS_STATE_FOLDER: ${{runner.workspace}}
run: ./wolftests --reporter JUnit::out=${{runner.workspace}}/report.xml --reporter console::out=-::colour-mode=ansi
- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure() # run this step even if previous step failed
with:
name: ${{matrix.cxx}} - STD ${{ matrix.std }} - Shared ${{ matrix.shared }}
path: ${{runner.workspace}}/report.xml
reporter: java-junit