Merge pull request #140 from nnewson/vcpkg-baseline-bump #217
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| # -------- Platform-independent lint gates (run once) -------- | |
| clang-format: | |
| name: clang-format | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install clang-format-22 | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y wget lsb-release software-properties-common | |
| wget -qO - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - | |
| sudo add-apt-repository "deb http://apt.llvm.org/$(lsb_release -cs)/ llvm-toolchain-$(lsb_release -cs)-22 main" | |
| sudo apt-get update | |
| sudo apt-get install -y clang-format-22 | |
| - name: Check formatting | |
| run: | | |
| find include src tests -type f \( \ | |
| -name '*.hpp' -o -name '*.cpp' -o -name '*.h' -o -name '*.cxx' \ | |
| \) -print0 | xargs -0 clang-format-22 --dry-run -Werror | |
| clang-tidy: | |
| name: clang-tidy | |
| runs-on: ubuntu-latest | |
| env: | |
| VCPKG_ROOT: ${{ github.workspace }}/vcpkg | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install system packages | |
| run: | | |
| sudo apt-get update | |
| # autoconf/autoconf-archive/automake/libtool are for ports vcpkg builds with `vcpkg_make`: | |
| # glfw3 3.5.1 pulls `pthread-stubs` on Linux, which is autotools-only and refuses to | |
| # configure without them. `autoconf-archive` is not preinstalled on ubuntu-latest. | |
| sudo apt-get install -y ninja-build cmake clang-tidy libvulkan-dev \ | |
| xorg-dev libxinerama-dev libxcursor-dev libglu1-mesa-dev pkg-config \ | |
| autoconf autoconf-archive automake libtool | |
| - name: Checkout vcpkg | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: microsoft/vcpkg | |
| path: vcpkg | |
| - name: Bootstrap vcpkg | |
| run: ./vcpkg/bootstrap-vcpkg.sh | |
| - name: Cache vcpkg packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| build/vcpkg_installed | |
| vcpkg/downloads | |
| vcpkg/buildtrees | |
| vcpkg/packages | |
| key: ${{ runner.os }}-vcpkg-${{ hashFiles('vcpkg.json', 'vcpkg-configuration.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-vcpkg- | |
| - name: Configure | |
| run: cmake --preset vcpkg -DFIRE_ENGINE_WARNINGS_AS_ERRORS=ON | |
| # clang-tidy needs the build tree (generated sources) present. | |
| - name: Build | |
| run: cmake --build build | |
| - name: clang-tidy | |
| run: cmake --build build --target run-clang-tidy | |
| # -------- Per-platform build + test (each validates its own determinism golden) -------- | |
| build-test-linux: | |
| name: build and test (Linux) | |
| runs-on: ubuntu-latest | |
| env: | |
| VCPKG_ROOT: ${{ github.workspace }}/vcpkg | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install system packages | |
| run: | | |
| sudo apt-get update | |
| # See the clang-tidy job above for why autotools are here: glfw3 3.5.1's `pthread-stubs` | |
| # dependency is autotools-only on Linux. | |
| sudo apt-get install -y ninja-build cmake libvulkan-dev \ | |
| xorg-dev libxinerama-dev libxcursor-dev libglu1-mesa-dev pkg-config \ | |
| autoconf autoconf-archive automake libtool | |
| - name: Checkout vcpkg | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: microsoft/vcpkg | |
| path: vcpkg | |
| - name: Bootstrap vcpkg | |
| run: ./vcpkg/bootstrap-vcpkg.sh | |
| - name: Cache vcpkg packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| build/vcpkg_installed | |
| vcpkg/downloads | |
| vcpkg/buildtrees | |
| vcpkg/packages | |
| key: ${{ runner.os }}-vcpkg-${{ hashFiles('vcpkg.json', 'vcpkg-configuration.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-vcpkg- | |
| - name: Configure | |
| run: cmake --preset vcpkg -DFIRE_ENGINE_WARNINGS_AS_ERRORS=ON | |
| - name: Build | |
| run: cmake --build build | |
| - name: Test | |
| run: cmake --build build --target tests-full | |
| build-test-macos: | |
| name: build and test (macOS) | |
| runs-on: macos-latest # Apple Silicon (arm64) — matches local dev + the macOS/arm64 golden | |
| env: | |
| VCPKG_ROOT: ${{ github.workspace }}/vcpkg | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Everything else — the Vulkan loader + headers, GLFW, VMA, and the glslc shader compiler | |
| # (vcpkg `shaderc` port) — comes from vcpkg, exactly as on Linux. ninja is the only tool the | |
| # macOS runner doesn't ship; MoltenVK isn't needed because tests-full is headless. | |
| - name: Install ninja | |
| run: brew install ninja | |
| - name: Checkout vcpkg | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: microsoft/vcpkg | |
| path: vcpkg | |
| - name: Bootstrap vcpkg | |
| run: ./vcpkg/bootstrap-vcpkg.sh | |
| - name: Cache vcpkg packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| build/vcpkg_installed | |
| vcpkg/downloads | |
| vcpkg/buildtrees | |
| vcpkg/packages | |
| key: ${{ runner.os }}-vcpkg-${{ hashFiles('vcpkg.json', 'vcpkg-configuration.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-vcpkg- | |
| - name: Configure | |
| run: cmake --preset vcpkg -DFIRE_ENGINE_WARNINGS_AS_ERRORS=ON | |
| - name: Build | |
| run: cmake --build build | |
| - name: Test | |
| run: cmake --build build --target tests-full |