-
Notifications
You must be signed in to change notification settings - Fork 18
238 lines (213 loc) · 10.7 KB
/
build.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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
name: "Cross-platform check"
on:
push:
paths:
- 'include/**'
- 'src/**'
- 'CMakeLists.txt'
pull_request:
# workflow_dispatch:
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
jobs:
linux:
name: ${{ matrix.config.name }}, VulkanSDK ${{ matrix.vulkan-sdk }}, VMA=${{ matrix.vma }}
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
config:
#- {
# name: "linux: clang",
# cc: "clang",
# cxx: "clang++"
#}
- {
name: "linux: gcc",
cc: "gcc-13",
cxx: "g++-13"
}
# note: if a specific vulkan version (e.g. 1.1.x, or < 1.2.135) needs testing, you can add it here:
# (not that ubuntu-latest (20.04) only supports >= v1.2.148 via apt)
vulkan-sdk: ["latest", "1.3.243", "1.2.198"]
vma: ["ON", "OFF"]
exclude: # exclude combinations that are known to fail
- vulkan-sdk: "1.2.198"
vma: "ON"
steps:
- uses: actions/checkout@v3
- name: Create Build Environment
shell: bash
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: |
# Add lunarg apt sources
sudo sed -i -e 's|disco|noble|g' /etc/apt/sources.list
sudo apt update
wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add -
if [ "${{ matrix.vulkan-sdk }}" = "latest" ]; then
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-noble.list https://packages.lunarg.com/vulkan/lunarg-vulkan-noble.list
else
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-${{ matrix.vulkan-sdk }}-noble.list https://packages.lunarg.com/vulkan/${{ matrix.vulkan-sdk }}/lunarg-vulkan-${{ matrix.vulkan-sdk }}-noble.list
fi
# For GCC-13
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/ppa
# Update package lists
sudo apt-get update -qq
# Install dependencies
sudo apt-get install -y \
vulkan-sdk \
g++-13 \
gcc-13
# clang does not yet (<= 12) support "Down with typename" (P0634R3), which is used in libstdc++ >= 11 in the ranges-header
if [ "${{ matrix.config.cc }}" = "clang" ]; then
sudo apt remove libgcc-11-dev gcc-11
fi
cmake -E make_directory ${{ runner.workspace }}/build
- name: Configure CMake
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
shell: bash
working-directory: ${{ runner.workspace }}/build
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run: |
export CC=${{ matrix.config.cc }}
export CXX=${{ matrix.config.cxx }}
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -Davk_LibraryType=STATIC $GITHUB_WORKSPACE -Davk_UseVMA=${{ matrix.vma }}
- name: Build
shell: bash
working-directory: ${{ runner.workspace }}/build
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build .
windows:
name: ${{ matrix.config.name }}, windows-2019, VulkanSDK ${{ matrix.vulkan-sdk }}, VMA=${{ matrix.vma }}
runs-on: windows-2019
env:
vulkan_sdk: "$GITHUB_WORKSPACE/vulkan_sdk/"
strategy:
fail-fast: false
matrix:
config:
- {
name: "windows: msvc",
cc: "cl",
cxx: "cl"
}
# note: if a specific vulkan version needs testing, you can add it here:
vulkan-sdk: ["latest", "1.3.243.0", "1.2.198.1"]
vma: ["ON", "OFF"]
exclude: # exclude combinations that are known to fail
- vulkan-sdk: "1.2.198.1"
vma: "ON"
steps:
# apparently checkout@v3 pulls to Auto-Vk/Auto-Vk on windows
- uses: actions/checkout@v3
- name: Create Build Environment
# apparently checkout@v3 pulls to Auto-Vk/Auto-Vk on windows
working-directory: ${{ runner.workspace }}/${{ github.event.repository.name }}
shell: pwsh
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: |
If ('${{ matrix.vulkan-sdk }}' -eq 'latest') {
# the download URL for the latest SDK version changes sometimes (every four months or so?)...
curl -LS -o vulkan-sdk.exe https://sdk.lunarg.com/sdk/download/latest/windows/vulkan-sdk.exe
} Else {
curl -LS -o vulkan-sdk.exe https://sdk.lunarg.com/sdk/download/${{ matrix.vulkan-sdk }}/windows/VulkanSDK-${{ matrix.vulkan-sdk }}-Installer.exe
}
7z x vulkan-sdk.exe -o"${{ env.vulkan_sdk }}"
mkdir "${{ env.vulkan_sdk }}Include/vma/"
curl -LS -o "${{ env.vulkan_sdk }}Include/vma/vk_mem_alloc.h" https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/blob/master/include/vk_mem_alloc.h?raw=true
# apparently checkout@v2 pulls to Auto-Vk/Auto-Vk on windows
cmake -E make_directory ${{ runner.workspace }}/${{ github.event.repository.name }}/build
- name: Configure CMake
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
shell: pwsh
# apparently checkout@v2 pulls to Auto-Vk/Auto-Vk on windows
working-directory: ${{ runner.workspace }}/${{ github.event.repository.name }}/build
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run: |
$env:CC="${{ matrix.config.cc }}"
$env:CXX="${{ matrix.config.cxx }}"
$env:Path += ";${{ env.vulkan_sdk }}\;${{ env.vulkan_sdk }}\Bin\"
$env:VULKAN_SDK="${{ env.vulkan_sdk }}"
$env:Vulkan_LIBRARY="${{ env.vulkan_sdk }}/Bin"
$env:Vulkan_INCLUDE_DIR="${{ env.vulkan_sdk }}/Include"
# apparently checkout@v2 pulls to Auto-Vk/Auto-Vk on windows
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -Davk_LibraryType=STATIC ${{ runner.workspace }}/${{ github.event.repository.name }} -Davk_UseVMA=${{ matrix.vma }} -G "Visual Studio 16 2019" -A x64
- name: Build
shell: bash
# apparently checkout@v3 pulls to Auto-Vk/Auto-Vk on windows
working-directory: ${{ runner.workspace }}/${{ github.event.repository.name }}/build
# Execute the build. You can specify a specific target with "--target <NAME>"
run: VULKAN_SDK=${{ env.vulkan_sdk }} cmake --build . --config $BUILD_TYPE
windows-latest:
name: ${{ matrix.config.name }}, windows-latest, VulkanSDK ${{ matrix.vulkan-sdk }}, VMA=${{ matrix.vma }}
runs-on: windows-latest
env:
vulkan_sdk: "$GITHUB_WORKSPACE/vulkan_sdk/"
strategy:
fail-fast: false
matrix:
config:
- {
name: "windows: msvc",
cc: "cl",
cxx: "cl"
}
# note: if a specific vulkan version needs testing, you can add it here:
vulkan-sdk: ["latest", "1.3.243.0", "1.2.198.1"]
vma: ["ON", "OFF"]
exclude: # exclude combinations that are known to fail
- vulkan-sdk: "1.2.198.1"
vma: "ON"
steps:
# apparently checkout@v3 pulls to Auto-Vk/Auto-Vk on windows
- uses: actions/checkout@v3
- name: Create Build Environment
# apparently checkout@v3 pulls to Auto-Vk/Auto-Vk on windows
working-directory: ${{ runner.workspace }}/${{ github.event.repository.name }}
shell: pwsh
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: |
If ('${{ matrix.vulkan-sdk }}' -eq 'latest') {
# the download URL for the latest SDK version changes sometimes (every four months or so?)...
curl -LS -o vulkan-sdk.exe https://sdk.lunarg.com/sdk/download/latest/windows/vulkan-sdk.exe
} Else {
curl -LS -o vulkan-sdk.exe https://sdk.lunarg.com/sdk/download/${{ matrix.vulkan-sdk }}/windows/VulkanSDK-${{ matrix.vulkan-sdk }}-Installer.exe
}
7z x vulkan-sdk.exe -o"${{ env.vulkan_sdk }}"
mkdir "${{ env.vulkan_sdk }}Include/vma/"
curl -LS -o "${{ env.vulkan_sdk }}Include/vma/vk_mem_alloc.h" https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/blob/master/include/vk_mem_alloc.h?raw=true
# apparently checkout@v3 pulls to Auto-Vk/Auto-Vk on windows
cmake -E make_directory ${{ runner.workspace }}/${{ github.event.repository.name }}/build
- name: Configure CMake
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
shell: pwsh
# apparently checkout@v2 pulls to Auto-Vk/Auto-Vk on windows
working-directory: ${{ runner.workspace }}/${{ github.event.repository.name }}/build
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run: |
$env:CC="${{ matrix.config.cc }}"
$env:CXX="${{ matrix.config.cxx }}"
$env:VULKAN_SDK="${{ env.vulkan_sdk }}"
$env:Vulkan_LIBRARY="${{ env.vulkan_sdk }}/Bin"
$env:Vulkan_INCLUDE_DIR="${{ env.vulkan_sdk }}/Include"
$env:Path += ";${{ env.vulkan_sdk }}\;${{ env.vulkan_sdk }}\Bin\"
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -Davk_LibraryType=STATIC ${{ runner.workspace }}/${{ github.event.repository.name }} -Davk_UseVMA=${{ matrix.vma }} -G "Visual Studio 17 2022" -A x64
- name: Build
shell: bash
# apparently checkout@v3 pulls to Auto-Vk/Auto-Vk on windows
working-directory: ${{ runner.workspace }}/${{ github.event.repository.name }}/build
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build . --config $BUILD_TYPE