Skip to content

Commit

Permalink
[ci|dep] Fix ci & update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
IceflowRE committed Jul 30, 2024
1 parent 50378ec commit d1e29e9
Show file tree
Hide file tree
Showing 6 changed files with 104 additions and 78 deletions.
47 changes: 29 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ on:
types: [opened]

env:
INEXOR_VULKAN_VERSION: "1.3.216.0"
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:
Expand All @@ -24,25 +26,25 @@ jobs:
- {
name: "Ubuntu Clang (Debug)",
compiler: "clang",
cc: "clang-14", cxx: "clang++-14",
cc: "clang-18", cxx: "clang++-18",
build_type: "Debug"
}
- {
name: "Ubuntu Clang (Release)",
compiler: "clang",
cc: "clang-14", cxx: "clang++-14",
cc: "clang-18", cxx: "clang++-18",
build_type: "Release"
}
- {
name: "Ubuntu GCC (Debug)",
compiler: "gcc",
cc: "gcc-12", cxx: "g++-12",
cc: "gcc-14", cxx: "g++-14",
build_type: "Debug"
}
- {
name: "Ubuntu GCC (Release)",
compiler: "gcc",
cc: "gcc-12", cxx: "g++-12",
cc: "gcc-14", cxx: "g++-14",
build_type: "Release"
}

Expand All @@ -54,14 +56,17 @@ jobs:
apt update -qq
# Install build tools
apt-get install -y \
gcc-12 \
clang-14 \
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 \
Expand All @@ -88,12 +93,15 @@ jobs:
- name: Install Vulkan SDK
shell: bash
run: |
# Download Vulkan SDK
curl -LS -o vulkansdk.tar.gz \
https://sdk.lunarg.com/sdk/download/${{ env.INEXOR_VULKAN_VERSION }}/linux/vulkansdk-linux-x86_64-${{ env.INEXOR_VULKAN_VERSION }}.tar.gz
# Create Vulkan SDK directory and extract
mkdir "${{ env.INEXOR_VULKAN_SDK_PATH }}"
tar xfz vulkansdk.tar.gz -C "${{ env.INEXOR_VULKAN_SDK_PATH }}"
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
Expand All @@ -105,11 +113,14 @@ jobs:
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=ON \
-DINEXOR_BUILD_TESTS=ON \
-DINEXOR_BUILD_BENCHMARKS=OFF \
-DINEXOR_BUILD_TESTS=OFF \
-DCMAKE_CXX_FLAGS="-Wall -Wextra" \
-GNinja \
${{ matrix.config.cmake_configure_options }}
Expand Down Expand Up @@ -204,15 +215,14 @@ jobs:
shell: pwsh
run: |
choco upgrade --no-progress llvm
curl -fsSL -o "LLVM_VS2017.zip" "https://github.com/zufuliu/llvm-utils/releases/download/v23.03/LLVM_VS2017.zip"
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
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
Expand All @@ -221,6 +231,7 @@ jobs:
$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 `
Expand Down
28 changes: 19 additions & 9 deletions .github/workflows/static_analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ jobs:
container: ubuntu:rolling
env:
DEBIAN_FRONTEND: "noninteractive"
INEXOR_VULKAN_VERSION: "1.3.216.0"
INEXOR_VULKAN_VERSION: "1.3.283.0"
INEXOR_VULKAN_SDK_PATH: "$GITHUB_WORKSPACE/../vulkan_sdk/"
INEXOR_VULKAN_SDK_CHECKSUM_LINUX: "8005e2cf3e89c80cbe1c0d0a259c88248de3257b4fc6fdefb47409edb3e43ecb"

steps:
- name: Update environment
run: |
Expand All @@ -28,6 +30,8 @@ jobs:
curl \
git \
libgl1-mesa-dev \
libwayland-dev \
libxkbcommon-dev \
libx11-dev \
libx11-xcb-dev \
libxcb-dri3-dev \
Expand All @@ -54,23 +58,29 @@ jobs:
pip3 install --break-system-packages wheel setuptools
- name: Install Vulkan SDK
shell: bash
run: |
# Download Vulkan SDK
curl -LS -o vulkansdk.tar.gz \
https://sdk.lunarg.com/sdk/download/${{ env.INEXOR_VULKAN_VERSION }}/linux/vulkansdk-linux-x86_64-${{ env.INEXOR_VULKAN_VERSION }}.tar.gz
# Create Vulkan SDK directory and extract
mkdir "${{ env.INEXOR_VULKAN_SDK_PATH }}"
tar xfz vulkansdk.tar.gz -C "${{ env.INEXOR_VULKAN_SDK_PATH }}"
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
run: |
export CC=gcc
export CXX=g++
export VULKAN_SDK="${{ env.INEXOR_VULKAN_SDK_PATH }}/${{ env.INEXOR_VULKAN_VERSION}}/x86_64"
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
cmake . -Bbuild -DCMAKE_BUILD_TYPE=Debug -GNinja -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
- name: Run clang-tidy
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ set(INEXOR_APP_VERSION_MINOR 1)
set(INEXOR_APP_VERSION_PATCH 0)

# Download dependencies through CMake
include (cmake/dependencies.cmake)
include(cmake/dependencies.cmake)

# Enable GCC/clang ANSI-colored terminal output using Ninja build tool
# TODO: Switch to `CMAKE_COLOR_DIAGNOSTICS` with cmake 3.24 in the future
Expand Down
50 changes: 26 additions & 24 deletions cmake/dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,87 +6,89 @@ set(FETCHCONTENT_QUIET OFF)

FetchContent_Declare(benchmark
GIT_REPOSITORY https://github.com/google/benchmark
GIT_TAG v1.7.1
GIT_TAG v1.8.5
GIT_SHALLOW ON
GIT_PROGRESS ON
FIND_PACKAGE_ARGS 1.7.1)
FIND_PACKAGE_ARGS 1.8.5)

FetchContent_Declare(fmt
GIT_REPOSITORY https://github.com/fmtlib/fmt.git
GIT_TAG 9.1.0
GIT_TAG 11.0.1
GIT_SHALLOW ON
GIT_PROGRESS ON
FIND_PACKAGE_ARGS 9.1.0)
FIND_PACKAGE_ARGS 11.0.1)

set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE)
set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE)
FetchContent_Declare(glfw
GIT_REPOSITORY https://github.com/glfw/glfw.git
GIT_TAG 3.3.8
GIT_TAG 3.4
GIT_SHALLOW ON
GIT_PROGRESS ON
FIND_PACKAGE_ARGS 3.3.8)
FIND_PACKAGE_ARGS 3.4)

FetchContent_Declare(glm
GIT_REPOSITORY https://github.com/g-truc/glm.git
GIT_TAG 0.9.9.8
GIT_TAG 1.0.1
GIT_SHALLOW ON
GIT_PROGRESS ON)

FetchContent_Declare(gtest
GIT_REPOSITORY https://github.com/google/googletest
GIT_TAG v1.13.0
GIT_TAG v1.15.0
GIT_SHALLOW ON
GIT_PROGRESS ON
FIND_PACKAGE_ARGS 1.13.0)
FIND_PACKAGE_ARGS 1.15.0)

FetchContent_Declare(imgui
GIT_REPOSITORY https://github.com/ocornut/imgui.git
GIT_TAG v1.89.4
GIT_TAG v1.90.9
GIT_SHALLOW ON
GIT_PROGRESS ON
FIND_PACKAGE_ARGS 1.89.4)
FIND_PACKAGE_ARGS 1.90.9)

set(SPDLOG_FMT_EXTERNAL ON CACHE BOOL "" FORCE)
FetchContent_Declare(spdlog
GIT_REPOSITORY https://github.com/gabime/spdlog.git
GIT_TAG v1.11.0
GIT_TAG v1.14.1
GIT_SHALLOW ON
GIT_PROGRESS ON
FIND_PACKAGE_ARGS 1.11.0)
FIND_PACKAGE_ARGS 1.14.1)

FetchContent_Declare(stb
GIT_REPOSITORY https://github.com/nothings/stb.git
GIT_TAG 5736b15f7ea0ffb08dd38af21067c314d6a3aae9
GIT_TAG f7f20f39fe4f206c6f19e26ebfef7b261ee59ee4
GIT_PROGRESS ON)

FetchContent_Declare(tinygltf
GIT_REPOSITORY https://github.com/syoyo/tinygltf.git
GIT_TAG v2.8.6
GIT_TAG v2.9.2
GIT_PROGRESS ON
FIND_PACKAGE_ARGS 2.8.6)
FIND_PACKAGE_ARGS 2.9.2)

FetchContent_Declare(toml
GIT_REPOSITORY https://github.com/ToruNiina/toml11.git
GIT_TAG v3.7.1
GIT_TAG v4.0.3
GIT_SHALLOW ON
GIT_PROGRESS ON
FIND_PACKAGE_ARGS 3.7.1)
FIND_PACKAGE_ARGS 4.0.3)

FetchContent_Declare(vma
GIT_REPOSITORY https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git
GIT_TAG v3.0.1
GIT_TAG v3.1.0
GIT_PROGRESS ON
FIND_PACKAGE_ARGS 3.0.1)
FIND_PACKAGE_ARGS 3.1.0)

FetchContent_Declare(volk
GIT_REPOSITORY https://github.com/zeux/volk
GIT_TAG 1.3.215
GIT_TAG 1.3.270
GIT_PROGRESS ON
FIND_PACKAGE_ARGS 1.3.215)
FIND_PACKAGE_ARGS 1.3.270)

# is not be used because we install the whole Vulkan SDK, but stays here for fallback
FetchContent_Declare(Vulkan
GIT_REPOSITORY https://github.com/KhronosGroup/Vulkan-Headers
GIT_TAG v1.3.215
GIT_TAG v1.3.283
GIT_PROGRESS ON
FIND_PACKAGE_ARGS 1.3.215)
FIND_PACKAGE_ARGS 1.3.283)
32 changes: 21 additions & 11 deletions helper/req_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
from argparse import ArgumentParser
from pathlib import Path

import pkg_resources
import importlib.metadata as im
import packaging.version as pv
import re
import sys


Expand All @@ -33,21 +35,29 @@ def main():
with Path(args.req_file).open(mode='r', encoding='UTF-8') as reader:
dependencies = reader.read()

success = True
success: bool = True
rx_pkg: re.Pattern = re.compile(r"(.+)(==|<=|>=)(.+)")
for pkg in dependencies.split('\n'):
match: re.Match = rx_pkg.match(pkg)
pkg_name: str = match.group(1)
pkg_req: str = match.group(2)
pkg_version: pv.Version = pv.parse(match.group(3))
try:
pkg_resources.require(pkg)
except pkg_resources.DistributionNotFound:
installed_version: pv.Version = pv.parse(im.version(pkg_name))
if (
pkg_req == "==" and installed_version != pkg_version
or pkg_req == "<=" and installed_version > pkg_version
or pkg_req == ">=" and installed_version < pkg_version
):
success = False
if not args.quiet:
print(f"Found: '{installed_version}', but '{pkg_req}{pkg_version}' is required.")
elif not args.quiet:
print(f"Found: '{pkg}'.")
except im.PackageNotFoundError:
success = False
if not args.quiet:
print(f"Did not found '{pkg}', but is required.")
except pkg_resources.VersionConflict as ex:
success = False
if not args.quiet:
print(f"Found: '{ex.dist}', but '{ex.req}' is required.")
else:
if not args.quiet:
print(f"Found: '{pkg}'.")
exit(0) if success else exit(1)


Expand Down
Loading

0 comments on commit d1e29e9

Please sign in to comment.