-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (78 loc) · 2.51 KB
/
cmake-multi-platform.yml
File metadata and controls
90 lines (78 loc) · 2.51 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
name: CMake Build Test
on: [push, pull_request]
jobs:
linux-builds:
name: Linux (${{ matrix.display_server }})
runs-on: ubuntu-latest
strategy:
matrix:
display_server: [Wayland, X11]
steps:
- uses: actions/checkout@v4
- name: Setup Vulkan SDK
uses: humbletim/setup-vulkan-sdk@v1.2.1
with:
vulkan-query-version: 1.4.304.1
vulkan-components: Vulkan-Headers, Vulkan-Loader
vulkan-use-cache: true
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake
if [ "${{ matrix.display_server }}" = "Wayland" ]; then
# Minimal OpenGL headers for Wayland compatibility
sudo apt-get install -y libgl1-mesa-dev
# Wayland-specific packages
sudo apt-get install -y \
libwayland-dev \
wayland-protocols \
libxkbcommon-dev
else
sudo apt-get install -y xorg-dev
fi
- name: Set CMake variables
run: |
if [ "${{ matrix.display_server }}" = "Wayland" ]; then
echo "USE_WAYLAND=ON" >> $GITHUB_ENV
echo "WAYLAND_DISPLAY=wayland-0" >> $GITHUB_ENV
echo "DISPLAY=" >> $GITHUB_ENV
else
echo "USE_X11=ON" >> $GITHUB_ENV
echo "DISPLAY=:0" >> $GITHUB_ENV
fi
- name: Configure and Build
run: |
mkdir build && cd build
cmake \
-DUSE_WAYLAND=${{ matrix.display_server == 'Wayland' && 'ON' || 'OFF' }} \
-DUSE_X11=${{ matrix.display_server == 'X11' && 'ON' || 'OFF' }} \
-DCMAKE_BUILD_TYPE=Release ..
cmake --build . --config Release --parallel 4
- name: Run tests
run: |
cd build
ctest --output-on-failure
windows-build:
name: Windows
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Vulkan SDK
uses: humbletim/setup-vulkan-sdk@v1.2.1
with:
vulkan-query-version: 1.4.304.1
vulkan-components: Vulkan-Headers, Vulkan-Loader
vulkan-use-cache: true
- name: Install CMake
uses: lukka/get-cmake@latest
- name: Configure and Build
run: |
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build . --config Release
- name: Run tests
run: |
cd build
ctest --output-on-failure