-
Notifications
You must be signed in to change notification settings - Fork 16
175 lines (157 loc) · 5.54 KB
/
Copy pathbuild.yml
File metadata and controls
175 lines (157 loc) · 5.54 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
173
174
175
name: Build
on:
push:
branches: [ main ]
pull_request:
workflow_dispatch:
# Cancel superseded runs on the same branch
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false # one toolchain failing must not hide the others
matrix:
include:
- name: Linux GCC Release
os: ubuntu-22.04
compiler: gcc
cc: gcc
cxx: g++
build_type: Release
- name: Linux Clang Release
os: ubuntu-22.04
compiler: clang
cc: clang
cxx: clang++
build_type: Release
- name: Windows MSVC Debug
os: windows-2022
compiler: msvc
build_type: Debug
- name: Windows MSVC Release
os: windows-2022
compiler: msvc
build_type: Release
- name: Windows MSYS2 MinGW64 Release
os: windows-2022
compiler: mingw
build_type: Release
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
# ---------- system dependencies ----------
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends \
ninja-build pkg-config \
xorg-dev libx11-dev libwayland-dev libxkbcommon-dev libglu1-mesa-dev \
libvulkan-dev
- name: Install Vulkan SDK (Windows)
if: runner.os == 'Windows' && matrix.compiler != 'mingw'
uses: jakoch/install-vulkan-sdk-action@v1
with:
vulkan_version: 1.4.357.0
install_runtime: true
cache: true
stripdown: true
- name: Setup MSYS2 (MinGW64)
if: matrix.compiler == 'mingw'
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: >-
mingw-w64-x86_64-toolchain
mingw-w64-x86_64-cmake
mingw-w64-x86_64-ninja
mingw-w64-x86_64-vulkan-devel
# ---------- Catch2 (needed by find_package(Catch2 3 REQUIRED)) ----------
- name: Build and install Catch2
if: matrix.compiler != 'mingw'
shell: bash
run: |
cmake -S external/Catch2 -B external/Catch2/build \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/.deps" \
-DCMAKE_CXX_STANDARD=20 \
-DCMAKE_CXX_STANDARD_REQUIRED=ON \
-DBUILD_TESTING=OFF
cmake --build external/Catch2/build --config ${{ matrix.build_type }} --target install
- name: Build and install Catch2 (MinGW64)
if: matrix.compiler == 'mingw'
shell: msys2 {0}
run: |
cmake -S external/Catch2 -B external/Catch2/build -G Ninja \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/.deps" \
-DCMAKE_CXX_STANDARD=20 \
-DCMAKE_CXX_STANDARD_REQUIRED=ON \
-DBUILD_TESTING=OFF
cmake --build external/Catch2/build --target install
# ---------- configure + build ----------
- name: Configure (Linux)
if: runner.os == 'Linux'
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
run: |
cmake -S . -B build -G Ninja \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DDEFINE_SHIPPING=OFF \
-DCMAKE_PREFIX_PATH="${{ github.workspace }}/.deps"
- name: Configure (Windows)
if: runner.os == 'Windows' && matrix.compiler != 'mingw'
run: |
cmake -S . -B build -G "Visual Studio 17 2022" -A x64 `
-DDEFINE_SHIPPING=OFF `
-DENABLE_MULTICORE=ON `
-DCMAKE_PREFIX_PATH="${{ github.workspace }}/.deps"
- name: Configure (MinGW64)
if: matrix.compiler == 'mingw'
shell: msys2 {0}
run: |
cmake -S . -B build -G Ninja \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DDEFINE_SHIPPING=OFF \
-DCMAKE_PREFIX_PATH="${{ github.workspace }}/.deps"
- name: Build
if: matrix.compiler != 'mingw'
run: cmake --build build --config ${{ matrix.build_type }} --parallel
- name: Build (MinGW64)
if: matrix.compiler == 'mingw'
shell: msys2 {0}
run: cmake --build build --parallel
# ---------- run tests ----------
- name: Run FlingTests (Linux)
if: runner.os == 'Linux'
run: |
mkdir -p Logs
./build/FlingTests/bin/FlingTests
- name: Run FlingTests (Windows)
if: runner.os == 'Windows' && matrix.compiler != 'mingw'
shell: cmd
run: |
if not exist Logs mkdir Logs
build\FlingTests\bin\${{ matrix.build_type }}\FlingTests.exe
- name: Run FlingTests (MinGW64)
if: matrix.compiler == 'mingw'
shell: msys2 {0}
run: |
mkdir -p Logs
./build/FlingTests/bin/FlingTests.exe
# Doc-comment conventions for first-party sources (see docs/CodingStyle.md / issue #166).
# clang-format cannot enforce comment *content*; this script does.
comment-style:
name: Comment style
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Check documentation comment style
run: python3 scripts/check_comment_style.py