vulkan: use varying subgroup flag instead of full subgroups #101
This file contains 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: Build | |
on: | |
push: | |
branches: | |
- master | |
- develop | |
- 'feature/**' | |
- 'bugfix/**' | |
env: | |
vulkan_sdk_version: '1.3.250.1' | |
vulkan_sdk_modules: 'Vulkan-Headers Vulkan-Loader SPIRV-Tools Glslang' | |
zig_version: 0.11.0 | |
jobs: | |
build_ubuntu: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- { | |
name: "Ubuntu GCC", | |
compiler_invocation: 'g++', | |
is_zig: false, | |
} | |
# FIXME Restore Zig support | |
# - { | |
# name: "Ubuntu Zig", | |
# compiler_invocation: 'zig c++', | |
# is_zig: true, | |
# } | |
cmake_build_shared_libs: [ON, OFF] | |
cmake_build_type: [Debug, Release] | |
# NOTE: We're using a ternary op here, which is very wonky. | |
# https://7tonshark.com/posts/github-actions-ternary-operator/ | |
name: "${{ matrix.config.name }} ${{ matrix.cmake_build_shared_libs == 'ON' && 'Shared' || 'Static' }} ${{ matrix.cmake_build_type }}" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Install Zig | |
if: ${{ matrix.config.is_zig }} | |
uses: goto-bus-stop/setup-zig@v2 | |
with: | |
version: ${{ env.zig_version }} | |
- name: Install dependencies | |
run: | | |
sudo apt-get update -qq # Always do this step to prevent package urls to get outdated | |
sudo apt-get install -y libunwind-dev libx11-xcb-dev libxcb-xkb-dev libasound2-dev | |
sudo apt-get install -y build-essential cmake | |
sudo apt-get install -y ninja-build libcurl4-openssl-dev # For google crashpad | |
- name: Prepare Vulkan SDK | |
uses: humbletim/[email protected] | |
with: | |
vulkan-query-version: ${{ env.vulkan_sdk_version }} | |
vulkan-components: ${{ env.vulkan_sdk_modules }} | |
vulkan-use-cache: true | |
- name: Configure CMake | |
run: | | |
export CXX='${{ matrix.config.compiler_invocation }}' | |
cmake -H. -Bbuild \ | |
-DCMAKE_INSTALL_PREFIX=install \ | |
-DREAPER_DEBUG_BUILD=${{ matrix.cmake_build_type == 'Debug' && 'ON' || 'OFF'}} \ | |
-DBUILD_SHARED_LIBS=${{ matrix.cmake_build_shared_libs }} \ | |
-DREAPER_BUILD_WARNINGS_AS_ERRORS=ON \ | |
-DREAPER_GIT_HOOKS_AUTO_UPDATE=OFF \ | |
-DREAPER_RUN_CLANG_TIDY=OFF \ | |
-DREAPER_HEADLESS=ON \ | |
-DREAPER_USE_TRACY=OFF | |
- name: Build | |
run: cmake --build build | |
- name: Test | |
run: ctest --test-dir build --output-on-failure | |
- name: Install | |
if: ${{ matrix.cmake_build_type == 'Release' && matrix.cmake_build_shared_libs == 'OFF' && !matrix.config.is_zig }} | |
run: | | |
cmake --build build --target install | |
tar -cvf linux_build.tar install | |
- name: Upload package artifact | |
uses: actions/upload-artifact@v3 | |
if: ${{ matrix.cmake_build_type == 'Release' && matrix.cmake_build_shared_libs == 'OFF' && !matrix.config.is_zig }} | |
with: | |
name: linux_build | |
path: linux_build.tar | |
- name: Setup tmate session | |
if: ${{ failure() }} | |
uses: mxschmitt/action-tmate@v3 | |
timeout-minutes: 10 | |
build_windows: | |
runs-on: windows-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- { | |
name: "Windows MSVC", | |
} | |
cmake_generator: ["Visual Studio 17 2022"] | |
cmake_arch: [x64] | |
cmake_build_shared_libs: [ON, OFF] | |
cmake_build_type: [Debug, Release] | |
name: "${{ matrix.config.name }} ${{ matrix.cmake_build_shared_libs == 'ON' && 'Shared' || 'Static' }} ${{ matrix.cmake_build_type }}" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Prepare Vulkan SDK | |
uses: humbletim/[email protected] | |
with: | |
vulkan-query-version: ${{ env.vulkan_sdk_version }} | |
vulkan-components: ${{ env.vulkan_sdk_modules }} | |
vulkan-use-cache: true | |
- name: Install Ninja | |
uses: seanmiddleditch/gha-setup-ninja@master | |
- name: Configure CMake | |
run: | | |
cmake .\ -Bbuild ` | |
-G "${{ matrix.cmake_generator }}" ` | |
-A "${{ matrix.cmake_arch }}" ` | |
-DCMAKE_INSTALL_PREFIX=install ` | |
-DREAPER_DEBUG_BUILD=${{ matrix.cmake_build_type == 'Debug' && 'ON' || 'OFF'}} ` | |
-DBUILD_SHARED_LIBS=${{ matrix.cmake_build_shared_libs }} ` | |
-DREAPER_BUILD_WARNINGS_AS_ERRORS=ON ` | |
-DREAPER_GIT_HOOKS_AUTO_UPDATE=OFF ` | |
-DREAPER_RUN_CLANG_TIDY=OFF ` | |
-DREAPER_HEADLESS=ON ` | |
-DREAPER_USE_TRACY=OFF | |
- name: Build | |
run: cmake --build build --config ${{ matrix.cmake_build_type }} | |
- name: Test | |
run: ctest --test-dir build -C ${{ matrix.cmake_build_type }} --output-on-failure | |
- name: Install | |
if: ${{ matrix.cmake_build_type == 'Release' && matrix.cmake_build_shared_libs == 'OFF' }} | |
run: | | |
cmake --build build --config ${{ matrix.cmake_build_type }} --target install | |
tar -cvf windows_build.tar install | |
- name: Upload package artifact | |
uses: actions/upload-artifact@v3 | |
if: ${{ matrix.cmake_build_type == 'Release' && matrix.cmake_build_shared_libs == 'OFF' }} | |
with: | |
name: windows_build | |
path: windows_build.tar | |
deploy_on_itch_io: | |
runs-on: ubuntu-latest | |
needs: | |
- build_ubuntu | |
- build_windows | |
name: "Deploy to itch.io" | |
steps: | |
- name: Download package artifact | |
uses: actions/download-artifact@v3 | |
- name: Unpack artifacts | |
run: | | |
pushd linux_build && tar -xvf linux_build.tar && mv linux_build.tar .. && popd | |
pushd windows_build && tar -xvf windows_build.tar && mv windows_build.tar .. && popd | |
- name: Package | |
run: | | |
GIT_SHORT_HASH=$(echo ${{ github.sha }} | cut -c -7) | |
mv linux_build/install/version.txt linux_version.txt | |
mv linux_build/install linux_build/neptune-$(cat linux_version.txt)-$GIT_SHORT_HASH-linux | |
mv windows_build/install/version.txt windows_version.txt | |
mv windows_build/install windows_build/neptune-$(cat windows_version.txt)-$GIT_SHORT_HASH-windows | |
- name: Deploy | |
env: | |
itch_io_project_url: 'xryp/neptune' | |
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }} | |
run: | | |
curl -L -o butler.zip https://broth.itch.ovh/butler/linux-amd64/LATEST/archive/default | |
unzip butler.zip | |
chmod +x butler | |
./butler -V | |
# FIXME Get the exact value for the release string | |
./butler push --if-changed linux_build ${{ env.itch_io_project_url }}:linux-latest --userversion-file linux_version.txt | |
./butler push --if-changed windows_build ${{ env.itch_io_project_url }}:windows-latest --userversion-file windows_version.txt |