obs-StreamFX/.github/workflows/main.yml
Michael Fabian 'Xaymar' Dirks 7937ff4a44 cmake: Remove Auto-Dependency system
While the system helped users get started quickly, it also presented a unique problem by itself. As CMake grew, the code that supported this system became more and more fragile to the point of failing at random, with no indication of why it would fail. Additionally as OBS Studio 28.0 adopted a much nicer system, it is no longer necessary to have this system at all.

As an addition to this change, all systems that could rely on FindModules now do so. This drastically reduces the complexity of the CMake system, while allowing significantly more flexibility with what binaries are really being used. In the best case this should allow a prepared user to build StreamFX by itself within seconds.
2023-04-05 18:58:31 +02:00

217 lines
8.3 KiB
YAML

name: Build
on:
push:
branches:
- 'master'
tags:
- '*'
pull_request:
branches:
- '*'
concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true
env:
CACHE_VERSION: 2
LIBAOM_VERSION: "3.2.0.0"
jobs:
build:
strategy:
fail-fast: false
matrix:
runner: [ windows-2022, macos-12, ubuntu-22.04, ubuntu-20.04 ]
generator: [ MSVC, GCC, Clang ]
exclude:
- runner: windows-2022
generator: GCC
- runner: windows-2022
generator: Clang
- runner: macos-12
generator: MSVC
- runner: macos-12
generator: GCC
- runner: ubuntu-22.04
generator: MSVC
- runner: ubuntu-20.04
generator: MSVC
include:
# Windows supports MSVC
- runner: windows-2022
name: "Windows"
package_name: "windows"
CMAKE_SYSTEM_VERSION: "10.0.20348.0"
CMAKE_GENERATOR: "Visual Studio 17 2022"
CMAKE_GENERATOR_PLATFORM: "x64"
# MacOS supports Clang
- runner: macos-12
name: "MacOS"
package_name: "macos"
CMAKE_GENERATOR: "Xcode"
CMAKE_OSX_DEPLOYMENT_TARGET: "10.15"
CMAKE_OSX_ARCHITECTURES: "x86_64"
# Ubuntu needs version-specific binaries
- runner: ubuntu-22.04
name: "Ubuntu 22.04"
package_name: "ubuntu-22"
CMAKE_GENERATOR: "Ninja"
- runner: ubuntu-20.04
name: "Ubuntu 20.04"
package_name: "ubuntu-20"
CMAKE_GENERATOR: "Ninja"
runs-on: ${{ matrix.runner }}
name: "${{ matrix.name }} (${{ matrix.generator }})"
env:
CMAKE_GENERATOR: "${{ matrix.CMAKE_GENERATOR }}"
CMAKE_GENERATOR_PLATFORM: "${{ matrix.CMAKE_GENERATOR_PLATFORM }}"
CMAKE_GENERATOR_TOOLSET: "${{ matrix.CMAKE_GENERATOR_TOOLSET }}"
CMAKE_SYSTEM_VERSION: "${{ matrix.CMAKE_SYSTEM_VERSION }}"
CMAKE_OSX_DEPLOYMENT_TARGET: "${{ matrix.CMAKE_OSX_DEPLOYMENT_TARGET }}"
CMAKE_OSX_ARCHITECTURES: "${{ matrix.CMAKE_OSX_ARCHITECTURES }}"
steps:
- name: "Clone"
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- name: "Dependencies: Windows"
if: startsWith( matrix.runner, 'windows' )
run: |
curl "-kL" "https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.4/LLVM-14.0.4-win64.exe" "-f" "--retry" "5" "-o" "llvm.exe"
7z x -y -o"C:\Program Files\LLVM" llvm.exe "bin" "include" "lib" "libexec" "share" "Uninstall.exe"
echo "CLANG_PATH=\"C:\\Program Files\\LLVM\\bin\"" >> "${GITHUB_ENV}"
curl "-kL" "https://cdn.xaymar.com/ci/innosetup-6.2.1.exe" "-f" "--retry" "5" "-o" "inno.exe"
.\inno.exe /VERYSILENT /SP- /SUPPRESSMSGBOXES /NORESTART
- name: "Dependencies: Linux"
if: startsWith( matrix.runner, 'ubuntu' )
shell: bash
run: |
sudo apt-get -qq update
sudo apt-get purge libjpeg9-dev:amd64 libjpeg8-dev:amd64 libjpeg-turbo8-dev:amd64
sudo apt-get install \
build-essential \
checkinstall \
pkg-config \
cmake \
ninja-build \
git \
qtbase5-dev qtbase5-private-dev libqt5svg5-dev \
libavcodec-dev libavdevice-dev libavfilter-dev libavformat-dev libavutil-dev libswresample-dev libswscale-dev \
libcurl4-openssl-dev
# clang-format, clang-tidy
curl -jLo /tmp/llvm.sh "https://apt.llvm.org/llvm.sh"
chmod +x /tmp/llvm.sh
sudo /tmp/llvm.sh 14 all
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-14 800
sudo update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-14 800
echo "CLANG_PATH=/usr/bin" >> "${GITHUB_ENV}"
# Compiler
if [[ "${{ matrix.generator }}" = "GCC" ]]; then
sudo apt-get install gcc-10 g++10
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 800 --slave /usr/bin/g++ g++ /usr/bin/g++-10
echo "CC=gcc-10" >> "${GITHUB_ENV}"
echo "CXX=gcc-10" >> "${GITHUB_ENV}"
echo "LD=ld" >> "${GITHUB_ENV}"
elif [[ "${{ matrix.generator }}" = "Clang" ]]; then
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-14 800
sudo update-alternatives --install /usr/bin/clangd clangd /usr/bin/clangd-14 800
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-14 800
sudo update-alternatives --install /usr/bin/lld lld /usr/bin/lld-14 800
sudo update-alternatives --install /usr/bin/lldb lldb /usr/bin/lldb-14 800
echo "CC=clang-14" >> "${GITHUB_ENV}"
echo "CXX=clang++-14" >> "${GITHUB_ENV}"
echo "LD=lld" >> "${GITHUB_ENV}"
fi
- name: 'Dependencies: MacOS'
if: startsWith( matrix.runner, 'macos' )
shell: bash
run: |
curl -kL http://cdn.xaymar.com/ci/Packages-1.2.10.dmg -f --retry 5 -o "Packages.dmg"
sudo hdiutil attach ./Packages.dmg
pushd /Volumes/Packages*
sudo installer -pkg ./Install\ Packages.pkg -target /
echo "CLANG_PATH=$(brew --prefix llvm@14)/bin/" >> "${GITHUB_ENV}"
- name: "Configure & Build (Debug)"
continue-on-error: true
shell: bash
run: |
cmake -H. -B"build/debug" \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_INSTALL_PREFIX="build/debug/install" \
-DPACKAGE_NAME="streamfx-${{ matrix.package_name }}-debug" \
-DPACKAGE_PREFIX="build/package" \
-DENABLE_CLANG=TRUE -DCLANG_PATH="${{ env.CLANG_PATH }}" \
-DENABLE_PROFILING=ON
if [[ "${{ matrix.runner }}" = windows* ]]; then
cmake --build "build/debug" --config Debug --target INSTALL
elif [[ "${{ matrix.runner }}" = ubuntu* ]]; then
cmake --build "build/debug" --config Debug --target install
elif [[ "${{ matrix.runner }}" = macos* ]]; then
cmake --build "build/debug" --config Debug --target install
fi
- name: "Configure & Build (Release)"
shell: bash
run: |
cmake -H. -B"build/release" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_INSTALL_PREFIX="build/release/install" \
-DPACKAGE_NAME="streamfx-${{ matrix.package_name }}" \
-DPACKAGE_PREFIX="build/package" \
-DENABLE_CLANG=TRUE -DCLANG_PATH="${{ env.CLANG_PATH }}" \
-DENABLE_PROFILING=OFF
if [[ "${{ matrix.runner }}" = windows* ]]; then
cmake --build "build/release" --config RelWithDebInfo --target INSTALL
elif [[ "${{ matrix.runner }}" = ubuntu* ]]; then
cmake --build "build/release" --config RelWithDebInfo --target install/strip
elif [[ "${{ matrix.runner }}" = macos* ]]; then
cmake --build "build/release" --config RelWithDebInfo --target install
fi
- name: "Validate Formatting"
shell: bash
run: |
cmake --build "build/debug" --config Debug --target StreamFX_clang-format
cmake --build "build/release" --config RelWithDebInfo --target StreamFX_clang-format
git --no-pager diff --patch --minimal HEAD --
git update-index --refresh
git diff-index --quiet HEAD --
- name: "Package: Archives"
shell: bash
run: |
mkdir build/package
cmake --build "build/debug" --config RelWithDebInfo --target PACKAGE_7Z
cmake --build "build/release" --config RelWithDebInfo --target PACKAGE_7Z
- name: "Package: Installer (Windows)"
if: startsWith( matrix.runner, 'windows' )
shell: cmd
run: |
"C:\Program Files (x86)\Inno Setup 6\ISCC.exe" /V10 ".\build\debug\installer.iss"
"C:\Program Files (x86)\Inno Setup 6\ISCC.exe" /V10 ".\build\release\installer.iss"
- name: "Package: Installer (MacOS)"
if: startsWith( matrix.runner, 'macos' )
shell: bash
run: |
packagesbuild ./build/debug/installer.pkgproj
packagesbuild ./build/release/installer.pkgproj
- name: "Artifacts"
uses: actions/upload-artifact@v1
with:
name: ${{ matrix.runner }}-${{ matrix.generator }}-${{ matrix.CMAKE_BUILD_TYPE }}
path: build/package