-
Notifications
You must be signed in to change notification settings - Fork 0
191 lines (173 loc) · 6.24 KB
/
Copy pathcmake-multi-platform.yml
File metadata and controls
191 lines (173 loc) · 6.24 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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
name: CMake Build
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
build:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
permissions:
contents: read
strategy:
fail-fast: false
matrix:
include:
- name: windows-msvc
os: windows-2022
shell: pwsh
configure_command: >
python -m cmake -S "$env:GITHUB_WORKSPACE" -B "$env:GITHUB_WORKSPACE/build/ci"
-G "Visual Studio 17 2022"
-A x64
-DEPOCH_CI_HEADLESS_ONLY=ON
build_command: >
python -m cmake --build "$env:GITHUB_WORKSPACE/build/ci"
--config Release
--target epoch_ci_headless
test_command: >
python -m cmake -E chdir "$env:GITHUB_WORKSPACE/build/ci"
ctest -C Release --output-on-failure
- name: windows-msvc-cpp26
os: windows-2022
shell: pwsh
configure_command: >
python -m cmake -S "$env:GITHUB_WORKSPACE" -B "$env:GITHUB_WORKSPACE/build/ci"
-G "Visual Studio 17 2022"
-A x64
-DEPOCH_CI_HEADLESS_ONLY=ON
-DEPOCH_ENABLE_CPP26_LANE=ON
build_command: >
python -m cmake --build "$env:GITHUB_WORKSPACE/build/ci"
--config Release
--target epoch_ci_headless
test_command: |
python -m cmake -E chdir "$env:GITHUB_WORKSPACE/build/ci" ctest -C Release --output-on-failure
- name: linux-gcc
os: ubuntu-latest
shell: bash
configure_command: >
python -m cmake -S "$GITHUB_WORKSPACE" -B "$GITHUB_WORKSPACE/build/ci"
-G Ninja
-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++
-DCMAKE_BUILD_TYPE=Release
-DEPOCH_CI_HEADLESS_ONLY=ON
build_command: >
python -m cmake --build "$GITHUB_WORKSPACE/build/ci"
--target epoch_ci_headless
test_command: >
python -m cmake -E chdir "$GITHUB_WORKSPACE/build/ci"
ctest --output-on-failure
- name: linux-clang
os: ubuntu-latest
shell: bash
configure_command: >
python -m cmake -S "$GITHUB_WORKSPACE" -B "$GITHUB_WORKSPACE/build/ci"
-G Ninja
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
-DCMAKE_BUILD_TYPE=Release
-DEPOCH_CI_HEADLESS_ONLY=ON
build_command: >
python -m cmake --build "$GITHUB_WORKSPACE/build/ci"
--target epoch_ci_headless
test_command: >
python -m cmake -E chdir "$GITHUB_WORKSPACE/build/ci"
ctest --output-on-failure
- name: linux-clang-engine
os: ubuntu-latest
shell: bash
install_linux_render_deps: true
configure_command: >
python -m cmake -S "$GITHUB_WORKSPACE" -B "$GITHUB_WORKSPACE/build/linux-clang-engine"
-G Ninja
-DCMAKE_C_COMPILER=clang-18
-DCMAKE_CXX_COMPILER=clang++-18
-DCMAKE_CXX_COMPILER_CLANG_SCAN_DEPS=clang-scan-deps-18
-DCMAKE_BUILD_TYPE=Release
-DEPOCH_ENABLE_RAYLIB=OFF
-DEPOCH_ENABLE_SDL=OFF
-DEPOCH_ENABLE_SFML=ON
-DEPOCH_ENABLE_VULKAN=OFF
-DEPOCH_ENABLE_OPENGL=ON
-DEPOCH_ENABLE_SOFTWARE_RENDERER=ON
build_command: >
python -m cmake --build "$GITHUB_WORKSPACE/build/linux-clang-engine"
--parallel 2
test_command: >
python -m cmake -E chdir "$GITHUB_WORKSPACE/build/linux-clang-engine"
ctest --output-on-failure
steps:
- uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Upgrade pip
run: python -m pip install --upgrade pip
- name: Install modern CMake and Ninja
run: python -m pip install cmake==3.30.5 ninja
- name: Export Python tool shims on PATH (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$pythonDir = Split-Path (Get-Command python).Source -Parent
$scriptsDir = Join-Path $pythonDir 'Scripts'
Add-Content -Path $env:GITHUB_PATH -Value $pythonDir
if (Test-Path $scriptsDir) {
Add-Content -Path $env:GITHUB_PATH -Value $scriptsDir
}
- name: Export Python tool shims on PATH (Linux)
if: runner.os != 'Windows'
shell: bash
run: |
python_dir="$(dirname "$(command -v python)")"
echo "$python_dir" >> "$GITHUB_PATH"
- name: Report tool versions
run: |
python --version
python -m pip --version
cmake --version
ninja --version
- name: Install Linux rendering build dependencies
if: runner.os == 'Linux' && matrix.install_linux_render_deps == true
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y \
clang-18 \
clang-tools-18 \
libasio-dev \
libcurl4-openssl-dev \
libgl1-mesa-dev \
libsfml-dev \
libx11-dev \
libxi-dev \
libxrandr-dev \
libxrender-dev
- name: Configure (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: ${{ matrix.configure_command }}
- name: Configure (Linux)
if: runner.os != 'Windows'
shell: bash
run: ${{ matrix.configure_command }}
- name: Build (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: ${{ matrix.build_command }}
- name: Build (Linux)
if: runner.os != 'Windows'
shell: bash
run: ${{ matrix.build_command }}
- name: Test (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: ${{ matrix.test_command }}
- name: Test (Linux)
if: runner.os != 'Windows'
shell: bash
run: ${{ matrix.test_command }}