Skip to content

Commit

Permalink
Unified CI
Browse files Browse the repository at this point in the history
  • Loading branch information
stripe2933 committed Nov 19, 2024
1 parent 6252728 commit a8988ed
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 115 deletions.
31 changes: 23 additions & 8 deletions .github/workflows/macos.yml → .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: macOS
name: Build

env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
Expand All @@ -10,12 +10,16 @@ on:
- '!README.md'
- '!LICENSE.txt'
- '!docs/**'
- '!.github/workflows/*.yml'
- '.github/workflows/macos.yml'

jobs:
build:
runs-on: macOS-latest
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest, ubuntu-24.04]

steps:
- uses: actions/checkout@v4

Expand All @@ -26,10 +30,16 @@ jobs:
vulkan-components: Vulkan-Headers, Vulkan-Loader, Glslang, SPIRV-Tools
vulkan-use-cache: true

- name: Install latest LLVM, Ninja and build dependencies
- name: Install build dependencies (macOS)
if: ${{ matrix.os == 'macos-latest' }}
run: brew install llvm ninja autoconf automake libtool nasm

- name: Install vcpkg
- name: Install build dependencies (ubuntu-24.04)
if: ${{ matrix.os == 'ubuntu-24.04' }}
run: sudo apt-get install ninja-build libc++-dev libc++abi-dev xorg-dev libtool libltdl-dev

- name: Setup vcpkg (macOS)
if: ${{ matrix.os == 'macos-latest' }}
run: |
git clone https://github.com/microsoft/vcpkg.git --depth 1
cd vcpkg && ./bootstrap-vcpkg.sh
Expand All @@ -42,13 +52,18 @@ jobs:
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Workaround for CMake issue that cannot find __CMAKE::CXX23 target
- name: Enable Developer Command Prompt (Windows)
if: ${{ matrix.os == 'windows-latest' }}
uses: ilammy/msvc-dev-cmd@v1

- name: Workaround for CMake bug that cannot find __CMAKE::CXX23 target when using homebrew libc++ (macOS)
if: ${{ matrix.os == 'macos-latest' }}
run: sed -i '' 's|libc++.modules.json|../../c++/libc++.modules.json|g' /opt/homebrew/opt/cmake/share/cmake/Modules/Compiler/Clang-CXX-CXXImportStd.cmake # https://gitlab.kitware.com/cmake/cmake/-/issues/25965#note_1523575

- name: Configure
run: |
mv .github/workflows/scripts/* .
cmake --preset=macos-clang
cmake --preset=${{ matrix.os }}
- name: Build
run: cmake --build build --config release
48 changes: 0 additions & 48 deletions .github/workflows/linux.yml

This file was deleted.

29 changes: 18 additions & 11 deletions .github/workflows/scripts/CMakeUserPresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,11 @@
"version": 6,
"configurePresets": [
{
"name": "linux-clang-18",
"inherits": "default",
"cacheVariables": {
"CMAKE_C_COMPILER": "/usr/bin/clang-18",
"CMAKE_CXX_COMPILER": "/usr/bin/clang++-18",
"CMAKE_CXX_FLAGS": "-stdlib=libc++",
"CMAKE_EXE_LINKER_FLAGS": "-stdlib=libc++ -lc++abi",
"VCPKG_OVERLAY_TRIPLETS": "${sourceDir}/triplets",
"VCPKG_TARGET_TRIPLET": "x64-linux-clang"
}
"name": "windows-latest",
"inherits": "default"
},
{
"name": "macos-clang",
"name": "macos-latest",
"inherits": "default",
"cacheVariables": {
"CMAKE_C_COMPILER": "/opt/homebrew/opt/llvm/bin/clang",
Expand All @@ -24,6 +16,21 @@
"VCPKG_OVERLAY_TRIPLETS": "${sourceDir}/triplets",
"VCPKG_TARGET_TRIPLET": "arm64-macos-clang"
}
},
{
"name": "ubuntu-24.04",
"inherits": "default",
"cacheVariables": {
"CMAKE_C_COMPILER": "/usr/bin/clang-18",
"CMAKE_CXX_COMPILER": "/usr/bin/clang++-18",
"CMAKE_CXX_FLAGS": "-stdlib=libc++",
"CMAKE_EXE_LINKER_FLAGS": "-stdlib=libc++ -lc++abi",
"VCPKG_OVERLAY_TRIPLETS": "${sourceDir}/triplets",
"VCPKG_TARGET_TRIPLET": "x64-linux-clang"
},
"environment": {
"VCPKG_ROOT": "$env{VCPKG_INSTALLATION_ROOT}"
}
}
]
}
45 changes: 0 additions & 45 deletions .github/workflows/windows.yml

This file was deleted.

4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Vulkan glTF Viewer

![Windows](https://github.com/stripe2933/vk-gltf-viewer/actions/workflows/windows.yml/badge.svg)
![macOS](https://github.com/stripe2933/vk-gltf-viewer/actions/workflows/macos.yml/badge.svg)
![Linux](https://github.com/stripe2933/vk-gltf-viewer/actions/workflows/linux.yml/badge.svg)
![Build](https://github.com/stripe2933/vk-gltf-viewer/actions/workflows/build.yml/badge.svg)

Blazingly fast[^1] Vulkan glTF viewer.

Expand Down

0 comments on commit a8988ed

Please sign in to comment.