Skip to content

[merge] Merge pull request #559 from inexorgame/iceflower/ci_fox #3643

[merge] Merge pull request #559 from inexorgame/iceflower/ci_fox

[merge] Merge pull request #559 from inexorgame/iceflower/ci_fox #3643

Workflow file for this run

name: Build Code
on:
push:
pull_request:
types: [opened]
env:
INEXOR_VULKAN_VERSION: "1.3.283.0"
INEXOR_VULKAN_SDK_PATH: "$GITHUB_WORKSPACE/../vulkan_sdk/"
INEXOR_VULKAN_SDK_CHECKSUM_LINUX: "8005e2cf3e89c80cbe1c0d0a259c88248de3257b4fc6fdefb47409edb3e43ecb"
INEXOR_VULKAN_SDK_CHECKSUM_WINDOWS: "811fcb9b43d09248520b2f38ae9a3763fc81df950fdab874f23bd762b07a9b12"
jobs:
linux:
name: ${{ matrix.config.name }}
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' && github.event.action == 'opened' && !github.event.pull_request.merged || github.event_name == 'push' }}
container: ubuntu:rolling
env:
DEBIAN_FRONTEND: "noninteractive"
strategy:
fail-fast: false
matrix:
config:
- {
name: "Ubuntu Clang (Debug)",
compiler: "clang",
cc: "clang-18", cxx: "clang++-18",
build_type: "Debug"
}
- {
name: "Ubuntu Clang (Release)",
compiler: "clang",
cc: "clang-18", cxx: "clang++-18",
build_type: "Release"
}
- {
name: "Ubuntu GCC (Debug)",
compiler: "gcc",
cc: "gcc-14", cxx: "g++-14",
build_type: "Debug"
}
- {
name: "Ubuntu GCC (Release)",
compiler: "gcc",
cc: "gcc-14", cxx: "g++-14",
build_type: "Release"
}
steps:
- name: Update environment
shell: bash
run: |
# Update package lists
apt update -qq
# Install build tools
apt-get install -y \
gcc-14 \
g++-14 \
clang-18 \
cmake \
curl \
git \
libgl1-mesa-dev \
libwayland-dev \
libx11-dev \
libx11-xcb-dev \
libxkbcommon-dev \
libxcb-dri3-dev \
libxcb-icccm4-dev \
libxcb-image0-dev \
libxcb-keysyms1-dev \
libxcb-randr0-dev \
libxcb-render-util0-dev \
libxcb-render0-dev \
libxcb-shape0-dev \
libxcb-sync-dev \
libxcb-util-dev \
libxcb-xfixes0-dev \
libxcb-xinerama0-dev \
libxcb-xkb-dev \
lld \
ninja-build \
pkg-config \
python3 \
python3-pip \
xkb-data \
xorg-dev
pip3 install --break-system-packages wheel setuptools
- name: Install Vulkan SDK
shell: bash
run: |
curl -LS -o vulkansdk.tar.xz https://sdk.lunarg.com/sdk/download/${{ env.INEXOR_VULKAN_VERSION }}/linux/vulkansdk-linux-x86_64-${{ env.INEXOR_VULKAN_VERSION }}.tar.xz
echo "${{ env.INEXOR_VULKAN_SDK_CHECKSUM_LINUX }} vulkansdk.tar.xz" | sha256sum --check
mkdir -p ${{ env.INEXOR_VULKAN_SDK_PATH }}
tar xf vulkansdk.tar.xz -C "${{ env.INEXOR_VULKAN_SDK_PATH }}"
rm -rf vulkansdk.tar.xz
# runtime depenedencies
apt-get -y install qtbase5-dev libxcb-xinput0 libxcb-xinerama0
# remove bundled volk
rm -rf ${{ env.INEXOR_VULKAN_SDK_PATH }}/${{ env.INEXOR_VULKAN_VERSION }}/x86_64/lib/cmake/volk/
- name: Checkout
uses: actions/checkout@v3
- name: Configure CMake
shell: bash
run: |
export CC=${{ matrix.config.cc }}
export CXX=${{ matrix.config.cxx }}
export VULKAN_SDK="${{ env.INEXOR_VULKAN_SDK_PATH }}/${{ env.INEXOR_VULKAN_VERSION }}/x86_64"
export PATH=$VULKAN_SDK/bin:$PATH
export LD_LIBRARY_PATH=$VULKAN_SDK/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
export VK_LAYER_PATH=$VULKAN_SDK/share/vulkan/explicit_layer.d
# TODO: Bring back Google tests and benchmarks in Linux CI
cmake . \
-Bbuild \
-DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} \
-DINEXOR_BUILD_BENCHMARKS=OFF \
-DINEXOR_BUILD_TESTS=OFF \
-DCMAKE_CXX_FLAGS="-Wall -Wextra" \
-GNinja \
${{ matrix.config.cmake_configure_options }}
- name: Build
shell: bash
run: |
cmake --build build
- name: Prepare Build Artifacts
shell: bash
run: |
cd build
tar -zcvf "../build_linux_${{ matrix.config.build_type }}_${{ matrix.config.compiler }}.tar.xz" *
- name: Upload Build Artifacts
uses: actions/upload-artifact@v3
with:
name: build_linux_${{ matrix.config.build_type }}_${{ matrix.config.compiler }}.tar.xz
path: build_linux_${{ matrix.config.build_type }}_${{ matrix.config.compiler }}.tar.xz
- name: Prepare Nightly Artifacts
shell: bash
run: |
mkdir artifacts
cp ./build/example/inexor-vulkan-renderer-example artifacts/
cp -r ./configuration/ artifacts/
cp -r ./assets/ artifacts
mkdir -p ./artifacts/shaders
cp ./shaders/*.spv ./artifacts/shaders/
cd artifacts
tar -zcvf "../nightly_linux_${{ matrix.config.build_type }}_${{ matrix.config.compiler }}.tar.xz" *
- name: Upload Nightly Artifacts
uses: actions/upload-artifact@v3
with:
name: nightly_linux_${{ matrix.config.build_type }}_${{ matrix.config.compiler }}.tar.xz
path: nightly_linux_${{ matrix.config.build_type }}_${{ matrix.config.compiler }}.tar.xz
retention-days: 7
windows:
name: ${{ matrix.config.name }}
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
config:
- {
name: "Windows MSVC (Debug)",
compiler: "msvc",
cc: "cl", cxx: "cl",
cmake_configure_options: '-G "Visual Studio 17 2022" -A x64',
build_type: "Debug",
cmake_build_options: "--config Debug",
}
- {
name: "Windows MSVC (Release)",
compiler: "msvc",
cc: "cl", cxx: "cl",
cmake_configure_options: '-G "Visual Studio 17 2022" -A x64',
build_type: "Release",
cmake_build_options: "--config Release",
}
- {
name: "Windows Clang (Debug)",
compiler: "clang",
cc: "clang-cl", cxx: "clang-cl",
cmake_configure_options: '-G "Visual Studio 17 2022" -A x64 -T "LLVM_v143" -DCMAKE_CXX_COMPILER="clang-cl.exe" -DCMAKE_C_COMPILER="clang-cl.exe" -DCMAKE_LINKER="lld.exe"',
build_type: "Debug",
cmake_build_options: "--config Debug",
}
- {
name: "Windows Clang (Release)",
compiler: "clang",
cc: "clang-cl", cxx: "clang-cl",
cmake_configure_options: '-G "Visual Studio 17 2022" -A x64 -T "LLVM_v143" -DCMAKE_CXX_COMPILER="clang-cl.exe" -DCMAKE_C_COMPILER="clang-cl.exe" -DCMAKE_LINKER="lld.exe"',
build_type: "Release",
cmake_build_options: "--config Release",
}
steps:
- name: Update environment
shell: pwsh
run: |
pip3 install wheel setuptools
- name: Checkout
uses: actions/checkout@v3
- name: Configure LLVM
if: matrix.config.compiler == 'clang'
shell: pwsh
run: |
choco upgrade --no-progress llvm
curl -fsSL -o "LLVM_VS2017.zip" "https://github.com/zufuliu/llvm-utils/releases/download/v23.05/LLVM_VS2017.zip"
7z x -y "LLVM_VS2017.zip" >NUL
LLVM_VS2017\install.bat
- name: Install Vulkan SDK
shell: pwsh
run: |
curl -LS -o vulkansdk.exe https://sdk.lunarg.com/sdk/download/${{ env.INEXOR_VULKAN_VERSION }}/windows/VulkanSDK-${{ env.INEXOR_VULKAN_VERSION }}-Installer.exe
7z x vulkansdk.exe -o"${{ env.INEXOR_VULKAN_SDK_PATH }}"
- name: Configure CMake
shell: pwsh
run: |
$env:CC="${{ matrix.config.cc }}"
$env:CXX="${{ matrix.config.cxx }}"
$env:Path += ";${{ env.INEXOR_VULKAN_SDK_PATH }}\;${{ env.INEXOR_VULKAN_SDK_PATH }}\Bin\"
$env:VULKAN_SDK="${{ env.INEXOR_VULKAN_SDK_PATH }}"
# TODO: Bring back Google tests and benchmarks in Windows CI
cmake . `
-Bbuild `
-DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} `
-DINEXOR_BUILD_BENCHMARKS=OFF `
-DINEXOR_BUILD_TESTS=OFF `
${{ matrix.config.cmake_configure_options }}
- name: Build
shell: pwsh
run: |
cmake --build build ${{ matrix.config.cmake_build_options }}
- name: Prepare Build Artifacts
shell: pwsh
run: |
7z a -tzip "build_windows_${{ matrix.config.build_type }}_${{ matrix.config.compiler }}" ./build/*
- name: Upload Build Artifacts
uses: actions/upload-artifact@v3
with:
name: build_windows_${{ matrix.config.build_type }}_${{ matrix.config.compiler }}
path: build_windows_${{ matrix.config.build_type }}_${{ matrix.config.compiler }}.zip
- name: Prepare Nightly Artifacts
shell: pwsh
run: |
mkdir artifacts
cp -r ./build/example/${{ matrix.config.build_type }}/inexor-vulkan-renderer-example.exe artifacts
cp -r ./configuration/. artifacts
cp -r ./assets/. artifacts
mkdir -P ./artifacts/shaders
cp ./shaders/*.spv ./artifacts/shaders/
7z a -tzip "nightly_windows_${{ matrix.config.build_type }}_${{ matrix.config.compiler }}" ./artifacts/*
- name: Upload Nightly Artifacts
uses: actions/upload-artifact@v3
with:
name: nightly_windows_${{ matrix.config.build_type }}_${{ matrix.config.compiler }}
path: nightly_windows_${{ matrix.config.build_type }}_${{ matrix.config.compiler }}.zip
retention-days: 7