-
Notifications
You must be signed in to change notification settings - Fork 44
168 lines (151 loc) · 5.25 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
# Adapted from https://github.com/catchorg/Catch2/blob/devel/.github/workflows/linux-simple-builds.yml
name: Linux build and test
on:
push:
paths-ignore:
- "docs"
- "docker"
pull_request:
paths:
- "docs"
- "docker"
jobs:
test-arm:
timeout-minutes: 30
runs-on: [ self-hosted, ARM64 ] # self-hosted, using Oracle free tier instance
steps:
- uses: actions/checkout@v3
- 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 \
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 \
libsdl2-dev
- name: Setup Rust
uses: ATiltedTree/setup-rust@v1
with:
rust-version: stable
- name: Setup gst-wayland-display
run: |
git clone https://github.com/games-on-whales/gst-wayland-display
cd gst-wayland-display
cargo install cargo-c
cargo cinstall -p c-bindings --prefix=/usr/local
- name: Configure build
working-directory: ${{runner.workspace}}
run: |
cmake -Bbuild \
-H$GITHUB_WORKSPACE \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_EXTENSIONS=OFF \
-DCMAKE_CXX_STANDARD=17 \
-DTEST_UINPUT=OFF \
-DTEST_DOCKER=ON \
-DLINK_RUST_WAYLAND=ON \
-DTEST_RUST_WAYLAND=OFF \
-DTEST_NVIDIA=OFF \
-DTEST_EXCEPTIONS=OFF \
-DCARGO_TARGET_BUILD=aarch64-unknown-linux-gnu \
-G Ninja
- name: Build tests + lib
working-directory: ${{runner.workspace}}/build
run: ninja -j 4 wolftests
- name: Run tests
working-directory: ${{runner.workspace}}/build/tests
run: ./wolftests
test:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
cxx:
- g++-10
- g++-12
- clang++-11
- clang++-14
build_type: [ Release ]
shared: [ true, false ]
std: [ 17 ]
include:
- cxx: g++-10
other_pkgs: [ g++-10 ]
- cxx: g++-12
other_pkgs: [ g++-12 ]
- cxx: clang++-11
other_pkgs: [ clang-11 ]
- cxx: clang++-14
other_pkgs: [ clang-14 ]
steps:
- uses: actions/checkout@v3
- 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 \
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 \
libsdl2-dev
${{ join(matrix.other_pkgs, ' ') }}
- name: Setup Rust
uses: ATiltedTree/setup-rust@v1
with:
rust-version: stable
- name: Setup gst-wayland-display
run: |
git clone https://github.com/games-on-whales/gst-wayland-display
cd gst-wayland-display
cargo install cargo-c
cargo cinstall -p c-bindings --prefix=/usr/local --destdir=temp
sudo cp -r temp/usr/local/* /usr/local/
- 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_UINPUT=OFF \
-DTEST_DOCKER=OFF \
-DLINK_RUST_WAYLAND=ON \
-DTEST_RUST_WAYLAND=OFF \
-DTEST_NVIDIA=OFF \
-G Ninja
- name: Build tests + lib
working-directory: ${{runner.workspace}}/build
run: ninja -j 2 wolftests
- name: Run tests
working-directory: ${{runner.workspace}}/build/tests
run: ./wolftests