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 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473
|
# Copyright (c) 2021-2024 Valve Corporation
# Copyright (c) 2021-2024 LunarG, Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Author: Lenny Komow <lenny@lunarg.com>
# Author: Charles Giessen <charles@lunarg.com>
name: CI Build
# https://docs.github.com/en/actions/using-jobs/using-concurrency
concurrency:
# github.head_ref is only defined on pull_request
# Fallback to the run ID, which is guaranteed to be both unique and defined for the run.
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
on:
push:
pull_request:
branches:
- main
permissions: read-all
jobs:
linux:
needs: codegen
runs-on: ${{matrix.os}}
timeout-minutes: 30
strategy:
matrix:
compiler: [ {cc: gcc, cxx: g++}, {cc: clang, cxx: clang++} ]
config: [ Debug, Release ]
os: [ ubuntu-22.04, ubuntu-24.04 ]
steps:
- uses: actions/checkout@v6.0.1
- uses: actions/setup-python@v6
with:
python-version: '3.11'
- name: Test CMake min
# NOTE: The main users who benefit from an older CMake version
# are linux users stuck on older LTS releases. It's idiomatic best
# practice to try and support them so they don't have to install
# the CMake tarball. Ideally the minimum we use matches what the default
# package provided by Ubuntu via APT.
if: ${{ matrix.os == 'ubuntu-22.04' }}
uses: lukka/get-cmake@latest
with:
cmakeVersion: 3.22.1
- run: sudo apt update
- run: sudo apt install --yes --no-install-recommends libwayland-dev libxrandr-dev
- run: |
cmake -S. -B build \
-D CMAKE_BUILD_TYPE=${{ matrix.config }} \
-D BUILD_TESTS=ON \
-D UPDATE_DEPS=ON \
-D LOADER_ENABLE_ADDRESS_SANITIZER=ON \
-D BUILD_WERROR=ON \
-D CMAKE_CXX_COMPILER=${{ matrix.compiler.cxx }} \
-D CMAKE_C_COMPILER=${{ matrix.compiler.cc }}
- run: cmake --build build
- run: ctest --parallel --output-on-failure --test-dir build/
- run: cmake --install build --prefix /tmp
codegen:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v6.0.1
- run: scripts/update_deps.py --dir ext --no-build
- run: scripts/generate_source.py --verify ext/Vulkan-Headers/registry/
linux-no-asm:
needs: codegen
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v6.0.1
- run: sudo apt update
- run: sudo apt install --yes --no-install-recommends libwayland-dev libxrandr-dev
- run: |
cmake -S. -B build \
-D CMAKE_BUILD_TYPE=Release \
-D BUILD_TESTS=ON \
-D UPDATE_DEPS=ON \
-D BUILD_WERROR=ON \
-D USE_GAS=OFF \
-D CMAKE_C_COMPILER=clang \
-D CMAKE_CXX_COMPILER=clang++
- run: cmake --build build
- run: cmake --install build --prefix /tmp
- run: ctest --parallel --output-on-failure -E UnknownFunction --test-dir build/
linux-32:
needs: codegen
runs-on: ubuntu-24.04
timeout-minutes: 30
strategy:
matrix:
config: [ Debug, Release ]
steps:
- uses: actions/checkout@v6.0.1
- uses: actions/setup-python@v6
with:
python-version: '3.11'
- uses: lukka/get-cmake@latest
with:
cmakeVersion: 3.22.1
- name: Enable 32 bit
run: sudo dpkg --add-architecture i386
- run: sudo apt-get update
- run: |
sudo apt install --yes --no-install-recommends \
gcc-multilib g++-multilib libc6:i386 libc6-dev-i386 libgcc-s1:i386 \
libwayland-dev:i386 libxrandr-dev:i386
- run: |
cmake -S. -B build \
-D CMAKE_BUILD_TYPE=${{matrix.config}} \
-D BUILD_TESTS=ON \
-D UPDATE_DEPS=ON \
-D BUILD_WERROR=ON \
-D SYSCONFDIR=/etc/not_vulkan \
-D CMAKE_CXX_FLAGS=-m32 \
-D CMAKE_C_FLAGS=-m32 \
-G Ninja
env:
# https://gitlab.kitware.com/cmake/cmake/-/issues/25317
PKG_CONFIG_PATH: /usr/lib/i386-linux-gnu/pkgconfig
- run: cmake --build build
- run: cmake --install build --prefix /tmp
- run: ctest --parallel --output-on-failure --test-dir build/
linux-32-no-asm:
needs: codegen
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v6.0.1
- uses: actions/setup-python@v6
with:
python-version: '3.11'
- uses: lukka/get-cmake@latest
with:
cmakeVersion: 3.22.1
- name: Enable 32 bit
run: sudo dpkg --add-architecture i386
- run: sudo apt-get update
- run: |
sudo apt install --yes --no-install-recommends \
gcc-multilib g++-multilib libc6:i386 libc6-dev-i386 libgcc-s1:i386 \
libwayland-dev:i386 libxrandr-dev:i386
- run: |
cmake -S. -B build \
-D CMAKE_BUILD_TYPE=Release \
-D BUILD_TESTS=ON \
-D UPDATE_DEPS=ON \
-D BUILD_WERROR=ON \
-D USE_GAS=OFF \
-D CMAKE_CXX_FLAGS=-m32 \
-D CMAKE_C_FLAGS=-m32 \
-G Ninja
env:
# https://gitlab.kitware.com/cmake/cmake/-/issues/25317
PKG_CONFIG_PATH: /usr/lib/i386-linux-gnu/pkgconfig
- run: cmake --build build
- run: ctest --parallel --output-on-failure -E UnknownFunction --test-dir build/
linux-arm:
needs: codegen
runs-on: ubuntu-24.04-arm
timeout-minutes: 30
steps:
- uses: actions/checkout@v6.0.1
- uses: actions/setup-python@v6
with:
python-version: '3.11'
- name: Test CMake min
uses: lukka/get-cmake@latest
with:
cmakeVersion: 3.22.1
- run: sudo apt update
- run: sudo apt install --yes --no-install-recommends libwayland-dev libxrandr-dev
- run: |
cmake -S. -B build \
-D CMAKE_BUILD_TYPE=Debug \
-D BUILD_TESTS=ON \
-D UPDATE_DEPS=ON \
-D LOADER_ENABLE_ADDRESS_SANITIZER=ON \
-D BUILD_WERROR=ON
- run: cmake --build build
- run: ctest --parallel --output-on-failure --test-dir build/
- run: cmake --install build --prefix /tmp
windows_vs:
# windows is 2x expensive to run on GitHub machines, so only run if we know something else simple passed as well
needs: linux-no-asm
runs-on: windows-latest
timeout-minutes: 30
strategy:
matrix:
arch: [ Win32, x64 ]
config: [ Debug, Release ]
steps:
- uses: actions/checkout@v6.0.1
- run: |
cmake -S. -B build `
-D BUILD_TESTS=ON `
-D UPDATE_DEPS=ON `
-D CMAKE_BUILD_TYPE=${{matrix.config}} `
-A ${{ matrix.arch }} `
-D BUILD_WERROR=ON
- run: cmake --build build/ --config ${{matrix.config}}
- run: cmake --install build --prefix build/install --config ${{matrix.config}}
- run: ctest --parallel --output-on-failure -C ${{matrix.config}} --test-dir build/
windows_vs-no-asm:
# windows is 2x expensive to run on GitHub machines, so only run if we know something else simple passed as well
needs: linux-no-asm
runs-on: windows-latest
timeout-minutes: 30
strategy:
matrix:
arch: [ Win32, x64 ]
steps:
- uses: actions/checkout@v6.0.1
- run: |
cmake -S. -B build `
-D BUILD_TESTS=ON `
-D UPDATE_DEPS=ON `
-D USE_MASM=OFF `
-D CMAKE_BUILD_TYPE=Release `
-A ${{ matrix.arch }} `
-D BUILD_WERROR=ON
- run: cmake --build build/ --config Release
- run: ctest --parallel --output-on-failure -C Release -E UnknownFunction --test-dir build/
# Test both clang and clang-cl (Chromium project uses clang-cl)
windows_clang:
# windows is 2x expensive to run on GitHub machines, so only run if we know something else simple passed as well
needs: linux-no-asm
runs-on: windows-2022
timeout-minutes: 30
strategy:
matrix:
compiler: [ clang, clang-cl ]
config: [ Debug, Release ]
steps:
- uses: actions/checkout@v6.0.1
- uses: ilammy/msvc-dev-cmd@v1
- run: |
cmake -S. -B build `
-D CMAKE_C_COMPILER=${{matrix.compiler}} `
-D CMAKE_CXX_COMPILER=${{matrix.compiler}} `
-D UPDATE_DEPS=ON `
-D CMAKE_BUILD_TYPE=${{matrix.config}} `
-D BUILD_WERROR=ON `
-D BUILD_TESTS=ON `
-G Ninja
- run: cmake --build build/
- run: ctest --parallel --output-on-failure --test-dir build/
- run: cmake --install build --prefix build/install
mac:
# Mac is 10x expensive to run on GitHub machines, so only run if we know something else passed as well
needs: windows_clang
runs-on: macos-14
timeout-minutes: 30
strategy:
matrix:
config: [ Debug, Release ]
static_build: [ APPLE_STATIC_LOADER=ON, APPLE_STATIC_LOADER=OFF ]
steps:
- uses: actions/checkout@v6.0.1
- uses: actions/setup-python@v6
with:
python-version: '3.11'
- run: |
cmake -S. -B build \
-D CMAKE_BUILD_TYPE=${{matrix.config}} \
-D ${{matrix.static_build}} \
-D BUILD_TESTS=ON \
-D UPDATE_DEPS=ON \
-D BUILD_WERROR=ON \
-D LOADER_ENABLE_ADDRESS_SANITIZER=ON \
-G Ninja
env:
# Prevents regression of KhronosGroup/Vulkan-Loader/issues/1332
LDFLAGS: -Wl,-fatal_warnings
- run: cmake --build build
- run: cmake --install build --prefix /tmp
- run: ctest --parallel --output-on-failure --test-dir build/
apple-cross-compile:
# Mac is 10x expensive to run on GitHub machines, so only run if we know something else passed as well
needs: windows_clang
name: ${{ matrix.CMAKE_SYSTEM_NAME }}
runs-on: macos-14
timeout-minutes: 30
strategy:
matrix:
CMAKE_SYSTEM_NAME: [ iOS, tvOS ]
steps:
- uses: actions/checkout@v6.0.1
- uses: actions/setup-python@v6
with:
python-version: '3.11'
- run: |
cmake -S . -B build \
-D CMAKE_SYSTEM_NAME=${{ matrix.CMAKE_SYSTEM_NAME }} \
"-D CMAKE_OSX_ARCHITECTURES=arm64;x86_64" \
-D CMAKE_BUILD_TYPE=Debug \
-D UPDATE_DEPS=ON \
-D BUILD_WERROR=ON \
-G Ninja
env:
LDFLAGS: -Wl,-fatal_warnings
- run: cmake --build build
- run: cmake --install build --prefix /tmp
- name: Verify Universal Binary
run: |
vtool -show-build /tmp/lib/libvulkan.dylib | grep 'architecture x86_64'
vtool -show-build /tmp/lib/libvulkan.dylib | grep 'architecture arm64'
# Building a universal binary disables assembly automatically
# Furthermore the Vulkan SDK ships universal binaries
mac-univeral:
# Mac is 10x expensive to run on GitHub machines, so only run if we know something else passed as well
needs: windows_clang
name: "Universal Binary Testing (STATIC ${{ matrix.static }}) w/ ${{ matrix.generator }}"
runs-on: macos-latest
timeout-minutes: 30
strategy:
matrix:
static: [ 'ON', 'OFF' ]
generator: [ Ninja, Xcode ]
steps:
- uses: actions/checkout@v6.0.1
- uses: actions/setup-python@v6
with:
python-version: '3.11'
- run: |
cmake -S. -B build \
-D CMAKE_BUILD_TYPE=Release \
-D APPLE_STATIC_LOADER=${{matrix.static}} \
"-D CMAKE_OSX_ARCHITECTURES=arm64;x86_64" \
-D BUILD_TESTS=ON \
-D UPDATE_DEPS=ON \
-D BUILD_WERROR=ON \
-G ${{ matrix.generator }}
env:
LDFLAGS: -Wl,-fatal_warnings
- run: cmake --build build --config Release
- run: ctest --parallel --output-on-failure --build-config Release -E UnknownFunction --test-dir build/
- run: cmake --install build --config Release --prefix /tmp
- name: Verify Universal Binary
if: ${{ matrix.static == 'OFF' }}
run: |
vtool -show-build /tmp/lib/libvulkan.dylib | grep 'architecture x86_64'
vtool -show-build /tmp/lib/libvulkan.dylib | grep 'architecture arm64'
chromium:
needs: codegen
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v6.0.1
- run: scripts/gn/gn.py
mingw:
# windows is 2x expensive to run on GitHub machines, so only run if we know something else simple passed as well
needs: linux-no-asm
if: false # Disabled due to issues with msys2 making CMake unable to find a working compiler
runs-on: windows-2022
timeout-minutes: 30
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v6.0.1
- uses: actions/setup-python@v6
with:
python-version: '3.11'
- name: Setup uasm
run: |
C:/msys64/usr/bin/pacman -Sy --noconfirm --needed mingw-w64-x86_64-uasm
printf '%s\n' 'C:/msys64/mingw64/bin' >> $GITHUB_PATH
- name: UASM Check
run: uasm -?
- run: |
cmake -S. -B build \
-D UPDATE_DEPS=ON \
-D CMAKE_BUILD_TYPE=Release \
-D BUILD_WERROR=ON \
-G Ninja
- run: cmake --build build
- run: cmake --install build --prefix /tmp
mingw-use-gas:
# windows is 2x expensive to run on GitHub machines, so only run if we know something else simple passed as well
needs: linux-no-asm
runs-on: windows-2022
timeout-minutes: 30
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v6.0.1
- uses: actions/setup-python@v6
with:
python-version: '3.11'
- run: |
cmake -S. -B build \
-D UPDATE_DEPS=ON \
-D CMAKE_BUILD_TYPE=Release \
-D BUILD_WERROR=ON \
-D USE_GAS=ON \
-G Ninja
- run: cmake --build build
- run: cmake --install build --prefix /tmp
mingw-no-asm:
# windows is 2x expensive to run on GitHub machines, so only run if we know something else simple passed as well
needs: linux-no-asm
runs-on: windows-2022
timeout-minutes: 30
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v6.0.1
- uses: actions/setup-python@v6
with:
python-version: '3.11'
# Make sure this doesn't fail even without explicitly setting '-D USE_MASM=OFF' and without uasm
- run: |
cmake -S. -B build \
-D UPDATE_DEPS=ON \
-D CMAKE_BUILD_TYPE=Release \
-D BUILD_WERROR=ON \
-G Ninja
- run: cmake --build build
- run: cmake --install build --prefix /tmp
mingw-no-asm-explicit:
# windows is 2x expensive to run on GitHub machines, so only run if we know something else simple passed as well
needs: linux-no-asm
runs-on: windows-2022
timeout-minutes: 30
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v6.0.1
- run: |
cmake -S. -B build \
-D UPDATE_DEPS=ON \
-D CMAKE_BUILD_TYPE=Release \
-D BUILD_WERROR=ON \
-D USE_MASM=OFF \
-G Ninja
- run: cmake --build build
- run: cmake --install build --prefix /tmp
|