ci: Split workflows by platform

This splits the whole thing by the supported platforms to hopefully aid with future problem searching. While the combined script was nice, and allowed reducing the working overhead significantly, it also had collisions in what should have been defined.
This commit is contained in:
Michael Fabian 'Xaymar' Dirks 2023-05-13 22:27:45 +02:00 committed by Xaymar
parent 4b28f87d5c
commit 0e1db7fad5

View file

@ -22,63 +22,167 @@ env:
CACHE_VERSION: "2022-12-02" CACHE_VERSION: "2022-12-02"
jobs: jobs:
build: windows:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
runner: [ "windows-2022", "macos-12", "ubuntu-22.04", "ubuntu-20.04" ] runner: "windows-2022"
qt: [ 5, 6 ] name: "Windows"
generator: [ "MSVC", "GCC", "Clang" ] package_name: "windows"
exclude: compiler: [ "MSVC", "Clang" ]
- runner: windows-2022
generator: GCC
- runner: windows-2022
generator: Clang
- runner: windows-2022
qt: 5
- runner: macos-12
generator: MSVC
- runner: macos-12
generator: GCC
- runner: macos-12
qt: 5
- runner: ubuntu-22.04
generator: MSVC
- runner: ubuntu-22.04
qt: 5
- runner: ubuntu-20.04
generator: MSVC
- runner: ubuntu-20.04
qt: 6
include: include:
# Windows supports MSVC - compiler: "MSVC"
- runner: windows-2022
name: "Windows"
package_name: "windows"
CMAKE_SYSTEM_VERSION: "10.0.20348.0" CMAKE_SYSTEM_VERSION: "10.0.20348.0"
CMAKE_GENERATOR: "Visual Studio 17 2022" CMAKE_GENERATOR: "Visual Studio 17 2022"
CMAKE_GENERATOR_PLATFORM: "x64" CMAKE_GENERATOR_PLATFORM: "x64"
- compiler: "Clang"
# MacOS supports Clang CMAKE_SYSTEM_VERSION: "10.0.20348.0"
- runner: macos-12 CMAKE_GENERATOR: "Visual Studio 17 2022"
name: "MacOS" CMAKE_GENERATOR_TOOLSET: "ClangCL"
package_name: "macos" CMAKE_GENERATOR_PLATFORM: "x64"
CMAKE_GENERATOR: "Xcode"
CMAKE_OSX_DEPLOYMENT_TARGET: "11.0"
CMAKE_OSX_ARCHITECTURES: "x86_64;arm64"
# 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 }}" runs-on: "${{ matrix.runner }}"
name: "${{ matrix.name }} (${{ matrix.generator }}, Qt${{ matrix.qt }})" name: "${{ matrix.name }} (${{ matrix.compiler }})"
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 }}"
steps:
- name: "Clone"
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- name: "Gather Information"
id: info
shell: bash
run: |
# Define buildspec file
buildspec="${{ github.workspace }}/third-party/obs-studio/buildspec.json"
# Prebuilt Dependencies Version
IFS=$'\n' buildspecdata=($(node tools/buildspec.js "${buildspec}" "prebuilt" "windows-x64"))
echo "obs_deps_version=${buildspecdata[0]}" >> $GITHUB_ENV
echo "obs_deps_hash=${buildspecdata[1]}" >> $GITHUB_ENV
echo "obs_deps_url=${buildspecdata[2]}" >> $GITHUB_ENV
# Qt Version
IFS=$'\n' buildspecdata=($(node tools/buildspec.js "${buildspec}" "qt${{ matrix.qt }}" "windows-x64"))
echo "qt_version=${buildspecdata[0]}" >> $GITHUB_ENV
echo "qt_hash=${buildspecdata[1]}" >> $GITHUB_ENV
echo "qt_url=${buildspecdata[2]}" >> $GITHUB_ENV
# libOBS Version
echo "obs_version=$(cd "${{ github.workspace }}/third-party/obs-studio" && git describe --tags --long)"
- name: "Dependency: Qt (Cache)"
id: qt-cache
uses: actions/cache@v3
with:
path: "${{ github.workspace }}/build/qt"
key: "qt${{ env.qt_hash }}-${{ env.CACHE_VERSION }}"
- name: "Dependency: Qt"
id: qt
if: ${{ steps.qt-cache.outputs.cache-hit != 'true' }}
shell: bash
run: |
curl --retry 5 --retry-delay 30 -jLo /tmp/qt.zip "${{ env.qt_url }}"
if [[ ! -f "${{ github.workspace }}/build/qt" ]]; then mkdir -p "${{ github.workspace }}/build/qt"; fi
7z x -y -o"${{ github.workspace }}/build/qt" -- "/tmp/qt.zip"
- name: "Dependency: Prebuilt OBS Studio Dependencies (Cache)"
id: obsdeps-cache
uses: actions/cache@v3
with:
path: "${{ github.workspace }}/build/obsdeps"
key: "obsdeps${{ env.obs_deps_hash }}-${{ env.CACHE_VERSION }}"
- name: "Dependency: Prebuilt OBS Studio Dependencies"
id: obsdeps
if: ${{ steps.obsdeps-cache.outputs.cache-hit != 'true' }}
shell: bash
run: |
curl --retry 5 --retry-delay 30 -jLo /tmp/obsdeps.zip "${{ env.obs_deps_url }}"
if [[ ! -f "${{ github.workspace }}/build/obsdeps" ]]; then mkdir -p "${{ github.workspace }}/build/obsdeps"; fi
7z x -y -o"${{ github.workspace }}/build/obsdeps" -- "/tmp/obsdeps.zip"
- name: "Dependency: OBS Libraries (Cache)"
id: obs-cache
uses: actions/cache@v3
with:
path: "${{ github.workspace }}/build/obs"
key: "obs${{ env.obs_version }}-obsdeps${{ env.obs_deps_hash }}-qt${{ env.qt_hash }}-${{ env.CACHE_VERSION }}"
- name: "Dependency: OBS Libraries"
id: obs
if: ${{ steps.obs-cache.outputs.cache-hit != 'true' }}
shell: bash
run: |
cmake \
-S "${{ github.workspace }}/third-party/obs-studio" \
-B "${{ github.workspace }}/build/obs" \
-DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/build/obs/install" \
-DCMAKE_PREFIX_PATH="${{ github.workspace }}/build/obsdeps;${{ github.workspace }}/build/qt" \
-DENABLE_PLUGINS=OFF \
-DENABLE_UI=OFF \
-DENABLE_SCRIPTING=OFF
cmake \
--build "${{ github.workspace }}/build/obs" \
--config Release \
--target obs-frontend-api
cmake \
--install "${{ github.workspace }}/build/obs" \
--config Release \
--component obs_libraries
- name: "Configure"
continue-on-error: true
shell: bash
run: |
cmake \
-S "${{ github.workspace }}" \
-B "${{ github.workspace }}/build/ci" \
-DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/build/ci/install" \
-DPACKAGE_NAME="streamfx-${{ matrix.package_name }}" \
-DPACKAGE_PREFIX="${{ github.workspace }}/build/package" \
-DCMAKE_PREFIX_PATH="${{ github.workspace }}/build/obs/install;${{ github.workspace }}/build/qt;${{ github.workspace }}/build/obsdeps"
- name: "Build: Debug"
continue-on-error: true
shell: bash
env:
CMAKE_BUILD_TYPE: "Debug"
run: |
cmake --build "build/ci" --config ${{ env.CMAKE_BUILD_TYPE }} --target StreamFX
- name: "Build: Release"
shell: bash
env:
CMAKE_BUILD_TYPE: "RelWithDebInfo"
run: |
cmake --build "build/ci" --config ${{ env.CMAKE_BUILD_TYPE }} --target install
- name: "Packaging: Install InnoSetup"
if: startsWith( matrix.runner, 'windows' )
run: |
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: "Packaging"
shell: cmd
run: |
"C:\Program Files (x86)\Inno Setup 6\ISCC.exe" /V10 ".\build\ci\installer.iss"
- name: "Artifacts"
uses: actions/upload-artifact@v1
with:
name: "${{ matrix.runner }}-${{ matrix.compiler }}-qt${{ matrix.qt }}"
path: "${{ github.workspace }}/build/package"
macos:
strategy:
fail-fast: false
matrix:
runner: "macos-12"
name: "MacOS"
package_name: "macos"
compiler: [ "Clang" ]
include:
- compiler: "Clang"
CMAKE_GENERATOR: "Xcode"
CMAKE_OSX_DEPLOYMENT_TARGET: "10.15"
CMAKE_OSX_ARCHITECTURES: "x86_64;arm64"
runs-on: "${{ matrix.runner }}"
name: "${{ matrix.name }} (${{ matrix.compiler }})"
env: env:
CMAKE_GENERATOR: "${{ matrix.CMAKE_GENERATOR }}" CMAKE_GENERATOR: "${{ matrix.CMAKE_GENERATOR }}"
CMAKE_GENERATOR_PLATFORM: "${{ matrix.CMAKE_GENERATOR_PLATFORM }}" CMAKE_GENERATOR_PLATFORM: "${{ matrix.CMAKE_GENERATOR_PLATFORM }}"
@ -92,9 +196,184 @@ jobs:
with: with:
submodules: recursive submodules: recursive
fetch-depth: 0 fetch-depth: 0
- name: "Gather Information"
id: info
shell: bash
run: |
# Define buildspec file
buildspec="${{ github.workspace }}/third-party/obs-studio/buildspec.json"
- name: "Install Build Tools (Ubuntu)" # Prebuilt Dependencies Version
if: startsWith( matrix.runner, 'ubuntu' ) IFS=$'\n' buildspecdata=($(node tools/buildspec.js "${buildspec}" "prebuilt" "macos-universal"))
echo "obs_deps_version=${buildspecdata[0]}" >> $GITHUB_ENV
echo "obs_deps_hash=${buildspecdata[1]}" >> $GITHUB_ENV
echo "obs_deps_url=${buildspecdata[2]}" >> $GITHUB_ENV
# Qt Version
IFS=$'\n' buildspecdata=($(node tools/buildspec.js "${buildspec}" "qt${{ matrix.qt }}" "macos-universal"))
echo "qt_version=${buildspecdata[0]}" >> $GITHUB_ENV
echo "qt_hash=${buildspecdata[1]}" >> $GITHUB_ENV
echo "qt_url=${buildspecdata[2]}" >> $GITHUB_ENV
# libOBS Version
echo "obs_version=$(cd "${{ github.workspace }}/third-party/obs-studio" && git describe --tags --long)"
- name: "Dependency: Qt (Cache)"
id: qt-cache
uses: actions/cache@v3
with:
path: "${{ github.workspace }}/build/qt"
key: "qt${{ env.qt_hash }}-${{ env.CACHE_VERSION }}"
- name: "Dependency: Qt"
id: qt
if: ${{ steps.qt-cache.outputs.cache-hit != 'true' }}
shell: bash
run: |
curl --retry 5 --retry-delay 30 -jLo /tmp/qt.tar.xz "${{ env.qt_url }}"
if [[ ! -f "${{ github.workspace }}/build/qt" ]]; then mkdir -p "${{ github.workspace }}/build/qt"; fi
tar -xvf "/tmp/qt.tar.xz" -C "${{ github.workspace }}/build/qt"
- name: "Dependency: Prebuilt OBS Studio Dependencies (Cache)"
id: obsdeps-cache
uses: actions/cache@v3
with:
path: "${{ github.workspace }}/build/obsdeps"
key: "obsdeps${{ env.obs_deps_hash }}-${{ env.CACHE_VERSION }}"
- name: "Dependency: Prebuilt OBS Studio Dependencies"
id: obsdeps
if: ${{ steps.obsdeps-cache.outputs.cache-hit != 'true' }}
shell: bash
run: |
curl --retry 5 --retry-delay 30 -jLo /tmp/obsdeps.tar.xz "${{ env.obs_deps_url }}"
if [[ ! -f "${{ github.workspace }}/build/obsdeps" ]]; then mkdir -p "${{ github.workspace }}/build/obsdeps"; fi
tar -xvf "/tmp/obsdeps.tar.xz" -C "${{ github.workspace }}/build/obsdeps"
- name: "Dependency: OBS Libraries (Cache)"
id: obs-cache
uses: actions/cache@v3
with:
path: "${{ github.workspace }}/build/obs"
key: "obs${{ env.obs_version }}-obsdeps${{ env.obs_deps_hash }}-qt${{ env.qt_hash }}-${{ env.CACHE_VERSION }}"
- name: "Dependency: OBS Libraries"
id: obs
if: ${{ steps.obs-cache.outputs.cache-hit != 'true' }}
shell: bash
run: |
cmake \
-S "${{ github.workspace }}/third-party/obs-studio" \
-B "${{ github.workspace }}/build/obs" \
-DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/build/obs/install" \
-DCMAKE_PREFIX_PATH="${{ github.workspace }}/build/obsdeps;${{ github.workspace }}/build/qt" \
-DENABLE_PLUGINS=OFF \
-DENABLE_UI=OFF \
-DENABLE_SCRIPTING=OFF
cmake \
--build "${{ github.workspace }}/build/obs" \
--config Release \
--target obs-frontend-api
cmake \
--install "${{ github.workspace }}/build/obs" \
--config Release \
--component obs_libraries
- name: "Configure"
continue-on-error: true
shell: bash
run: |
cmake \
-S "${{ github.workspace }}" \
-B "${{ github.workspace }}/build/ci" \
-DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/build/ci/install" \
-DPACKAGE_NAME="streamfx-${{ matrix.package_name }}" \
-DPACKAGE_PREFIX="${{ github.workspace }}/build/package" \
-DCMAKE_PREFIX_PATH="${{ github.workspace }}/build/obs/install;${{ github.workspace }}/build/qt;${{ github.workspace }}/build/obsdeps"
- name: "Build: Debug"
continue-on-error: true
shell: bash
run: |
cmake --build "build/ci" --config Debug --target StreamFX
- name: "Build: Release"
shell: bash
env:
CMAKE_BUILD_TYPE: "RelWithDebInfo"
run: |
cmake --build "build/ci" --config RelWithDebInfo --target install
- name: 'Packaging: Install Packages'
if: startsWith( matrix.runner, 'macos' )
shell: bash
run: |
curl -kL https://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 /
- name: "Packaging"
shell: cmd
run: |
"C:\Program Files (x86)\Inno Setup 6\ISCC.exe" /V10 ".\build\ci\installer.iss"
- name: "Artifacts"
uses: actions/upload-artifact@v1
with:
name: "${{ matrix.runner }}-${{ matrix.compiler }}-qt${{ matrix.qt }}"
path: "${{ github.workspace }}/build/package"
ubuntu:
strategy:
fail-fast: false
matrix:
runner: [ "ubuntu-22.04", "ubuntu-20.04" ]
name: "Ubuntu"
package_name: "windows"
compiler: [ "GCC", "Clang" ]
qt: [ 5, 6 ]
exclude:
- runner: "ubuntu-22.04"
qt: 5
- runner: "ubuntu-20.04"
qt: 6
include:
- runner: "ubuntu-22.04"
compiler: "GCC"
name: "Ubuntu 22.04"
package_name: "ubuntu22.04-qt6"
CMAKE_GENERATOR: "Ninja"
CMAKE_C_COMPILER: "gcc-12"
CMAKE_CXX_COMPILER: "g++-12"
CMAKE_LINKER_COMPILER: "ld"
- runner: "ubuntu-22.04"
name: "Ubuntu 22.04 (Clang)"
package_name: "ubuntu22.04-qt6-clang"
CMAKE_GENERATOR: "Ninja"
CMAKE_C_COMPILER: "clang-16"
CMAKE_CXX_COMPILER: "clang++16"
CMAKE_LINKER_COMPILER: "lld"
- runner: "ubuntu-20.04"
compiler: "GCC"
name: "Ubuntu 20.04"
package_name: "ubuntu20.04-qt5"
CMAKE_GENERATOR: "Ninja"
CMAKE_C_COMPILER: "gcc-11"
CMAKE_CXX_COMPILER: "g++-11"
CMAKE_LINKER_COMPILER: "ld"
- runner: "ubuntu-20.04"
name: "Ubuntu 20.04 (Clang)"
package_name: "ubuntu20.04-qt5-clang"
CMAKE_GENERATOR: "Ninja"
CMAKE_C_COMPILER: "clang-16"
CMAKE_CXX_COMPILER: "clang++16"
CMAKE_LINKER_COMPILER: "lld"
runs-on: "${{ matrix.runner }}"
name: "${{ matrix.name }} (${{ matrix.compiler }}, Qt${{ matrix.qt }})"
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_C_COMPILER: "${{ matrix.CMAKE_C_COMPILER }}"
CMAKE_CXX_COMPILER: "${{ matrix.CMAKE_CXX_COMPILER }}"
CMAKE_LINKER_COMPILER: "${{ matrix.CMAKE_LINKER_COMPILER }}"
steps:
- name: "Clone"
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- name: "Install Build Tools"
shell: bash shell: bash
run: | run: |
sudo apt-get -qq update sudo apt-get -qq update
@ -105,195 +384,52 @@ jobs:
pkg-config \ pkg-config \
cmake \ cmake \
ninja-build \ ninja-build \
git \ git
gcc-10 g++10 if [[ "${{ matrix.compiler }}" = GCC ]]; then
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 800 --slave /usr/bin/g++ g++ /usr/bin/g++-10 if [[ "${{ matrix.runner }}" = ubuntu-20* ]]; then
sudo apt-get install \
- name: "Install LLVM/Clang (Windows)" binutils gcc-11 g++11
if: startsWith( matrix.runner, 'windows' ) sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 800 --slave /usr/bin/g++ g++ /usr/bin/g++-11
run: | else
curl "-kL" "https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.3/LLVM-16.0.3-win64.exe" "-f" "--retry" "5" "-o" "llvm.exe" sudo apt-get install \
7z x -y -o"C:\Program Files\LLVM" llvm.exe "bin" "include" "lib" "libexec" "share" "Uninstall.exe" binutils gcc-12 g++12
echo "CLANG_PATH=\"C:\\Program Files\\LLVM\\bin\"" >> "${GITHUB_ENV}" sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 800 --slave /usr/bin/g++ g++ /usr/bin/g++-12
- name: "Install LLVM/Clang (Ubuntu)"
if: startsWith( matrix.runner, 'ubuntu' )
shell: bash
run: |
curl -jLo /tmp/llvm.sh "https://apt.llvm.org/llvm.sh"
chmod +x /tmp/llvm.sh
sudo /tmp/llvm.sh 16 all
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-16 800
sudo update-alternatives --install /usr/bin/clangd clangd /usr/bin/clangd-16 800
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-16 800
sudo update-alternatives --install /usr/bin/lld lld /usr/bin/lld-16 800
sudo update-alternatives --install /usr/bin/lldb lldb /usr/bin/lldb-16 800
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-16 800
sudo update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-16 800
echo "CLANG_PATH=/usr/bin" >> "${GITHUB_ENV}"
- name: "Install LLVM/Clang (MacOS)"
if: startsWith( matrix.runner, 'macos' )
shell: bash
run: |
brew install llvm@16
LLVM_LOC=$(brew --prefix llvm@16)
echo "CLANG_PATH=${LLVM_LOC}/bin/" >> "${GITHUB_ENV}"
- name: "Install InnoSetup (Windows)"
if: startsWith( matrix.runner, 'windows' )
run: |
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: 'Install Packages (MacOS)'
if: startsWith( matrix.runner, 'macos' )
shell: bash
run: |
curl -kL https://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 /
- name: "Setup build Tools and gather Information"
id: info
shell: bash
run: |
# Define buildspec file
buildspec="${{ github.workspace }}/third-party/obs-studio/buildspec.json"
# Prebuilt Dependencies Version
if [[ "${{ matrix.runner }}" = windows* ]]; then
IFS=$'\n' buildspecdata=($(node tools/buildspec.js "${buildspec}" "prebuilt" "windows-x64"))
elif [[ "${{ matrix.runner }}" = macos* ]]; then
IFS=$'\n' buildspecdata=($(node tools/buildspec.js "${buildspec}" "prebuilt" "macos-universal"))
else
buildspecdata=(0000-00-00 "about:blank" "00000000000000000000000000000000")
fi
echo "obs_deps_version=${buildspecdata[0]}" >> $GITHUB_ENV
echo "obs_deps_hash=${buildspecdata[1]}" >> $GITHUB_ENV
echo "obs_deps_url=${buildspecdata[2]}" >> $GITHUB_ENV
# Qt Version
if [[ "${{ matrix.runner }}" = windows* ]]; then
IFS=$'\n' buildspecdata=($(node tools/buildspec.js "${buildspec}" "qt${{ matrix.qt }}" "windows-x64"))
elif [[ "${{ matrix.runner }}" = macos* ]]; then
IFS=$'\n' buildspecdata=($(node tools/buildspec.js "${buildspec}" "qt${{ matrix.qt }}" "macos-universal"))
else
buildspecdata=(0000-00-00 "about:blank" "00000000000000000000000000000000")
fi
echo "qt_version=${buildspecdata[0]}" >> $GITHUB_ENV
echo "qt_hash=${buildspecdata[1]}" >> $GITHUB_ENV
echo "qt_url=${buildspecdata[2]}" >> $GITHUB_ENV
# libOBS Version
echo "obs_version=$(cd "${{ github.workspace }}/third-party/obs-studio" && git describe --tags --long)"
# Compiler Setup
if [[ "${{ matrix.runner }}" = ubuntu* ]]; then
if [[ "${{ matrix.generator }}" = "GCC" ]]; then
echo "CC=gcc-10" >> "${GITHUB_ENV}"
echo "CXX=g++-10" >> "${GITHUB_ENV}"
echo "LD=ld" >> "${GITHUB_ENV}"
elif [[ "${{ matrix.generator }}" = "Clang" ]]; then
echo "CC=clang-16" >> "${GITHUB_ENV}"
echo "CXX=clang++-16" >> "${GITHUB_ENV}"
echo "LD=lld" >> "${GITHUB_ENV}"
fi fi
else
curl -jLo /tmp/llvm.sh "https://apt.llvm.org/llvm.sh"
chmod +x /tmp/llvm.sh
sudo /tmp/llvm.sh 16 all
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-16 800
sudo update-alternatives --install /usr/bin/clangd clangd /usr/bin/clangd-16 800
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-16 800
sudo update-alternatives --install /usr/bin/lld lld /usr/bin/lld-16 800
sudo update-alternatives --install /usr/bin/lldb lldb /usr/bin/lldb-16 800
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-16 800
sudo update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-16 800
fi fi
- name: "Dependency: Qt (Cache)"
id: qt-cache
if: ${{ ! startsWith( matrix.runner, 'ubuntu' ) }}
uses: actions/cache@v3
with:
path: "${{ github.workspace }}/build/qt"
key: "${{ matrix.runner }}-qt${{ matrix.qt }}_${{ env.qt_version }}_${{ env.qt_hash }}-${{ env.CACHE_VERSION }}"
- name: "Dependency: Qt" - name: "Dependency: Qt"
id: qt id: qt
if: ${{ startsWith( matrix.runner, 'ubuntu' ) || (steps.qt-cache.outputs.cache-hit != 'true') }}
shell: bash shell: bash
run: | run: |
if [[ "${{ matrix.runner }}" = windows* ]]; then if [[ ${{ matrix.qt }} -eq 5 ]]; then
curl --retry 5 --retry-delay 30 -jLo /tmp/qt.zip "${{ env.qt_url }}"
if [[ ! -f "${{ github.workspace }}/build/qt" ]]; then mkdir -p "${{ github.workspace }}/build/qt"; fi
7z x -y -o"${{ github.workspace }}/build/qt" -- "/tmp/qt.zip"
elif [[ "${{ matrix.runner }}" = macos* ]]; then
curl --retry 5 --retry-delay 30 -jLo /tmp/qt.tar.xz "${{ env.qt_url }}"
if [[ ! -f "${{ github.workspace }}/build/qt" ]]; then mkdir -p "${{ github.workspace }}/build/qt"; fi
tar -xvf "/tmp/qt.tar.xz" -C "${{ github.workspace }}/build/qt"
elif [[ "${{ matrix.runner }}" = ubuntu* ]]; then
if [[ ${{ matrix.qt }} -eq 5 ]]; then
sudo apt-get -y install -V \
qtbase5-dev qtbase5-private-dev libqt5svg5-dev
elif [[ ${{ matrix.qt }} -eq 6 ]]; then
sudo apt-get -y install -V \
qt6-base-dev qt6-base-private-dev libqt6svg6-dev libgles2-mesa-dev libegl1-mesa-dev libgl1-mesa-dev
fi
fi
- name: "Dependency: OBS Dependencies (FFmpeg, CURL, ...) (Cache)"
id: obsdeps-cache
if: ${{ ! startsWith( matrix.runner, 'ubuntu' ) }}
uses: actions/cache@v3
with:
path: "${{ github.workspace }}/build/obsdeps"
key: "${{ matrix.runner }}-obsdeps${{ env.obs_deps_version }}_${{ env.obs_deps_hash }}-${{ env.CACHE_VERSION }}"
- name: "Dependency: OBS Dependencies (FFmpeg, CURL, ...)"
id: obsdeps
if: ${{ startsWith( matrix.runner, 'ubuntu' ) || (steps.obsdeps-cache.outputs.cache-hit != 'true') }}
shell: bash
run: |
if [[ "${{ matrix.runner }}" = windows* ]]; then
curl --retry 5 --retry-delay 30 -jLo /tmp/obsdeps.zip "${{ env.obs_deps_url }}"
if [[ ! -f "${{ github.workspace }}/build/obsdeps" ]]; then mkdir -p "${{ github.workspace }}/build/obsdeps"; fi
7z x -y -o"${{ github.workspace }}/build/obsdeps" -- "/tmp/obsdeps.zip"
elif [[ "${{ matrix.runner }}" = macos* ]]; then
curl --retry 5 --retry-delay 30 -jLo /tmp/obsdeps.tar.xz "${{ env.obs_deps_url }}"
if [[ ! -f "${{ github.workspace }}/build/obsdeps" ]]; then mkdir -p "${{ github.workspace }}/build/obsdeps"; fi
tar -xvf "/tmp/obsdeps.tar.xz" -C "${{ github.workspace }}/build/obsdeps"
elif [[ "${{ matrix.runner }}" = ubuntu* ]]; then
sudo apt-get -y install -V \ sudo apt-get -y install -V \
libavcodec-dev libavdevice-dev libavfilter-dev libavformat-dev libavutil-dev libswresample-dev libswscale-dev \ qtbase5-dev qtbase5-private-dev libqt5svg5-dev
libcurl4-openssl-dev elif [[ ${{ matrix.qt }} -eq 6 ]]; then
sudo apt-get -y install -V \
qt6-base-dev qt6-base-private-dev libqt6svg6-dev libgles2-mesa-dev libegl1-mesa-dev libgl1-mesa-dev
fi fi
- name: "Dependency: Prebuilt OBS Studio Dependencies"
id: obsdeps
shell: bash
run: |
sudo apt-get -y install -V \
libavcodec-dev libavdevice-dev libavfilter-dev libavformat-dev libavutil-dev libswresample-dev libswscale-dev \
libcurl4-openssl-dev
- name: "Dependency: OBS Libraries" - name: "Dependency: OBS Libraries"
id: obs id: obs
if: ${{ steps.obs-cache.outputs.cache-hit != 'true' }}
shell: bash shell: bash
env:
CMAKE_BUILD_TYPE: "Release"
run: | run: |
if [[ "${{ matrix.runner }}" = ubuntu* ]]; then sudo apt-get install libobs-dev
# Extra requirements by libobs on Linux.
sudo apt-get install \
libavcodec-dev libavdevice-dev libavfilter-dev libavformat-dev libavutil-dev libswresample-dev libswscale-dev \
libx264-dev libcurl4-openssl-dev libmbedtls-dev libgl1-mesa-dev libjansson-dev libluajit-5.1-dev python3-dev \
libx11-dev libxcb-randr0-dev libxcb-shm0-dev libxcb-xinerama0-dev libxcomposite-dev libxinerama-dev \
libxcb1-dev libx11-xcb-dev libxcb-xfixes0-dev swig libcmocka-dev libxss-dev libglvnd-dev libgles2-mesa \
libgles2-mesa-dev libwayland-dev \
libasound2-dev libfdk-aac-dev libfontconfig-dev libfreetype6-dev libjack-jackd2-dev libpulse-dev \
libsndio-dev libspeexdsp-dev libudev-dev libv4l-dev libva-dev libvlc-dev libdrm-dev
fi
# I do not know why this is messing up, but it is, and I can't be bothered to fix it after two weeks of trying.
cmake \
-S "${{ github.workspace }}/third-party/obs-studio" \
-B "${{ github.workspace }}/build/obs" \
-DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/build/obs/install" \
-DCMAKE_BUILD_TYPE="${{ env.CMAKE_BUILD_TYPE }}" \
-DCMAKE_PREFIX_PATH="${{ github.workspace }}/build/obsdeps;${{ github.workspace }}/build/qt" \
-DENABLE_PLUGINS=OFF \
-DENABLE_UI=OFF \
-DENABLE_SCRIPTING=OFF -- \
-w -Wno-error=unused-command-line-argument
cmake \
--build "${{ github.workspace }}/build/obs" \
--config Release \
--target obs-frontend-api
cmake \
--install "${{ github.workspace }}/build/obs" \
--config Release \
--component obs_libraries
- name: "Configure" - name: "Configure"
continue-on-error: true continue-on-error: true
shell: bash shell: bash
@ -304,76 +440,25 @@ jobs:
${{ env.cmake_generator }} \ ${{ env.cmake_generator }} \
${{ env.cmake_generator_toolset }} \ ${{ env.cmake_generator_toolset }} \
${{ env.cmake_generator_platform }} \ ${{ env.cmake_generator_platform }} \
-DCMAKE_C_COMPILER="${{ env.CC }}" \
-DCMAKE_CXX_COMPILER="${{ env.CXX }}" \
-DCMAKE_LINKER="${{ env.LD }}" \
-DCMAKE_OSX_ARCHITECTURES="${{ matrix.CMAKE_OSX_ARCHITECTURES }}" \
-DCMAKE_OSX_DEPLOYMENT_TARGET="${{ matrix.CMAKE_OSX_DEPLOYMENT_TARGET }}" \
-DCMAKE_SYSTEM_VERSION="${{ matrix.CMAKE_SYSTEM_VERSION }}" \
-DCMAKE_BUILD_TYPE="${{ env.CMAKE_BUILD_TYPE }}" \
-DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/build/ci/install" \
-DPACKAGE_NAME="streamfx-${{ matrix.package_name }}" \ -DPACKAGE_NAME="streamfx-${{ matrix.package_name }}" \
-DPACKAGE_PREFIX="${{ github.workspace }}/build/package" \ -DPACKAGE_PREFIX="${{ github.workspace }}/build/package" \
-DENABLE_CLANG=TRUE -DCLANG_PATH="${{ env.CLANG_PATH }}" \ -Dlibobs_DIR="${{ github.workspace }}/build/obs/install"
-DENABLE_PROFILING=ON \
-Dlibobs_DIR="${{ github.workspace }}/build/obs/install" \
-DQt_DIR="${{ github.workspace }}/build/qt" \
-DFFmpeg_DIR="${{ github.workspace }}/build/obsdeps" \
-DCURL_DIR="${{ github.workspace }}/build/obsdeps"
- name: "Build: Debug" - name: "Build: Debug"
continue-on-error: true continue-on-error: true
shell: bash shell: bash
env:
CMAKE_BUILD_TYPE: "Debug"
run: | run: |
if [[ "${{ matrix.runner }}" = windows* ]]; then cmake --build "build/ci" --config Debug --target StreamFX
cmake --build "build/ci" --config ${{ env.CMAKE_BUILD_TYPE }} --target StreamFX
elif [[ "${{ matrix.runner }}" = ubuntu* ]]; then
cmake --build "build/ci" --config ${{ env.CMAKE_BUILD_TYPE }} --target StreamFX
elif [[ "${{ matrix.runner }}" = macos* ]]; then
cmake --build "build/ci" --config ${{ env.CMAKE_BUILD_TYPE }} --target StreamFX
fi
- name: "Build: Release" - name: "Build: Release"
shell: bash shell: bash
env:
CMAKE_BUILD_TYPE: "RelWithDebInfo"
run: | run: |
if [[ "${{ matrix.runner }}" = windows* ]]; then cmake --build "build/ci" --config RelWithDebInfo --target install/strip
cmake --build "build/ci" --config ${{ env.CMAKE_BUILD_TYPE }} --target install
elif [[ "${{ matrix.runner }}" = ubuntu* ]]; then
cmake --build "build/ci" --config ${{ env.CMAKE_BUILD_TYPE }} --target install/strip
elif [[ "${{ matrix.runner }}" = macos* ]]; then
cmake --build "build/ci" --config ${{ env.CMAKE_BUILD_TYPE }} --target install
fi
- name: "Packaging" - name: "Packaging"
shell: bash shell: bash
run: | run: |
mkdir "${{ github.workspace }}/build/package" mkdir "${{ github.workspace }}/build/package"
cmake --build "${{ github.workspace }}/build/ci" --config RelWithDebInfo --target PACKAGE_7Z cmake --build "${{ github.workspace }}/build/ci" --config RelWithDebInfo --target PACKAGE_7Z
- name: "Packaging (Windows)"
if: startsWith( matrix.runner, 'windows' )
shell: cmd
run: |
"C:\Program Files (x86)\Inno Setup 6\ISCC.exe" /V10 ".\build\ci\installer.iss"
- name: "Packaging (MacOS)"
if: startsWith( matrix.runner, 'macos' )
shell: bash
run: |
packagesbuild "${{ github.workspace }}/build/ci/installer.pkgproj"
- name: "Artifacts" - name: "Artifacts"
uses: actions/upload-artifact@v1 uses: actions/upload-artifact@v1
with: with:
name: "${{ matrix.runner }}-${{ matrix.generator }}-qt${{ matrix.qt }}" name: "${{ matrix.runner }}-${{ matrix.compiler }}-qt${{ matrix.qt }}"
path: "${{ github.workspace }}/build/package" path: "${{ github.workspace }}/build/package"
- name: "Validate clang-format"
shell: bash
run: |
cmake --build "${{ github.workspace }}/build/ci" --config Debug --target clang-format
cmake --build "${{ github.workspace }}/build/ci" --config RelWithDebInfo --target clang-format
git --no-pager diff --patch --minimal HEAD --
git update-index --refresh
git diff-index --quiet HEAD --