obs-StreamFX/.github/workflows/main.yml

268 lines
9.6 KiB
YAML
Raw Normal View History

name: Build
2021-03-22 21:30:05 +00:00
on:
push:
branches:
- 'master'
2020-09-25 19:06:59 +00:00
tags:
- '*'
pull_request:
2020-04-24 04:18:40 +00:00
branches:
- '*'
concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true
2020-11-02 15:52:21 +00:00
env:
CACHE_VERSION: 2
LIBAOM_VERSION: "3.2.0.0"
2020-11-02 15:52:21 +00:00
jobs:
build:
strategy:
fail-fast: false
2021-03-22 21:30:05 +00:00
matrix:
runner: [ windows-2022, ubuntu-22.04, macos-12, windows-2019, ubuntu-20.04, macos-11, macos-10.15 ]
generator: [ MSVC, GCC, Clang ]
CMAKE_BUILD_TYPE: [ Debug, RelWithDebInfo ]
exclude:
- runner: windows-2022
generator: GCC
- runner: windows-2019
generator: GCC
- runner: windows-2022
generator: Clang
- runner: windows-2019
generator: Clang
- runner: ubuntu-22.04
generator: MSVC
- runner: ubuntu-20.04
generator: MSVC
- runner: macos-12
generator: MSVC
- runner: macos-12
generator: GCC
- runner: macos-11
generator: MSVC
- runner: macos-11
generator: GCC
- runner: macos-10.15
generator: MSVC
- runner: macos-10.15
generator: GCC
include:
- runner: windows-2022
generator: MSVC
experimental: true
platform: "Windows 11"
PACKAGE_NAME: "windows-11"
CMAKE_SYSTEM_VERSION: "10.0.22000.0"
CMAKE_GENERATOR: "Visual Studio 17 2022"
CMAKE_GENERATOR_PLATFORM: "x64"
- runner: windows-2019
generator: MSVC
experimental: false
platform: "Windows 10"
PACKAGE_NAME: "windows-10"
CMAKE_SYSTEM_VERSION: "10.0.19041.0"
CMAKE_GENERATOR: "Visual Studio 16 2019"
CMAKE_GENERATOR_PLATFORM: "x64"
- runner: ubuntu-22.04
generator: GCC
experimental: false
platform: "Ubuntu 22"
compiler_c: gcc
compiler_cxx: g++
PACKAGE_NAME: "ubuntu-22-gcc"
CMAKE_GENERATOR: "Ninja"
- runner: ubuntu-20.04
generator: GCC
experimental: false
platform: "Ubuntu 20"
compiler_c: gcc
compiler_cxx: g++
PACKAGE_NAME: "ubuntu-20-gcc"
CMAKE_GENERATOR: "Ninja"
- runner: ubuntu-22.04
generator: Clang
experimental: false
platform: "Ubuntu 22"
compiler_c: clang
compiler_cxx: clang++
PACKAGE_NAME: "ubuntu-22-clang"
CMAKE_GENERATOR: "Ninja"
- runner: ubuntu-20.04
generator: Clang
experimental: false
platform: "Ubuntu 20"
compiler_c: clang
compiler_cxx: clang++
PACKAGE_NAME: "ubuntu-20-clang"
CMAKE_GENERATOR: "Ninja"
- runner: macos-12
generator: Clang
experimental: true
platform: "MacOS 12"
PACKAGE_NAME: "macos-12"
CMAKE_GENERATOR: "Xcode"
CMAKE_OSX_DEPLOYMENT_TARGET: "10.15"
- runner: macos-11
generator: Clang
experimental: false
platform: "MacOS 11"
PACKAGE_NAME: "macos-11"
CMAKE_GENERATOR: "Xcode"
CMAKE_OSX_DEPLOYMENT_TARGET: "10.15"
- runner: macos-10.15
generator: Clang
experimental: true
platform: "MacOS 10.15"
PACKAGE_NAME: "macos-10.15"
CMAKE_GENERATOR: "Xcode"
CMAKE_OSX_DEPLOYMENT_TARGET: "10.15"
name: "${{ matrix.platform }} (${{ matrix.generator }}, ${{ matrix.CMAKE_BUILD_TYPE }})"
runs-on: ${{ matrix.runner }}
continue-on-error: ${{ matrix.experimental }}
env:
CC: ${{ matrix.compiler_c }}
CXX: ${{ matrix.compiler_cxx }}
CMAKE_GENERATOR: ${{ matrix.CMAKE_GENERATOR }}
CMAKE_GENERATOR_PLATFORM: ${{ matrix.CMAKE_GENERATOR_PLATFORM }}
2022-06-11 02:46:34 +00:00
CMAKE_GENERATOR_TOOLSET: ${{ matrix.CMAKE_GENERATOR_TOOLSET }}
CMAKE_SYSTEM_VERSION: ${{ matrix.CMAKE_SYSTEM_VERSION }}
CMAKE_OSX_DEPLOYMENT_TARGET: "${{ matrix.CMAKE_OSX_DEPLOYMENT_TARGET }}"
steps:
2021-03-23 15:42:34 +00:00
- name: "Clone"
uses: actions/checkout@v3
with:
submodules: recursive
2021-03-23 15:42:34 +00:00
fetch-depth: 0
2022-08-03 05:27:35 +00:00
- 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"
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
2022-08-03 05:27:35 +00:00
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
elif [[ "${{ matrix.generator }}" = "Clang" ]]; then
2022-08-06 18:31:46 +00:00
curl -jLo /tmp/llvm.sh https://apt.llvm.org/llvm.sh
sudo bash -x /tmp/llvm.sh 14 all
2022-08-03 05:27:35 +00:00
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/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
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
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 /
- name: "Auto-Dependency Cache"
if: github.event_name != 'pull_request'
uses: actions/cache@v3
2021-03-23 15:42:34 +00:00
with:
path: |
build/temp/autodeps
key: autodeps-${{ matrix.runner }}-${{ matrix.generator }}-${{ matrix.CMAKE_BUILD_TYPE }}-${{ env.CACHE_VERSION }}
- name: "Configure"
shell: bash
env:
CODESIGN_FILE: ${{ github.workspace }}/cert.pfx
CODESIGN_PASS: ${{ secrets.CODESIGN_CERT_WIN_PASSWORD }}
run: |
2022-08-03 05:27:35 +00:00
if [[ "${{ matrix.CMAKE_BUILD_TYPE }}" = "Debug" ]]; then
ENABLE_PROFILING=ON
else
ENABLE_PROFILING=OFF
fi
cmake -H. -B"build/temp" \
-DCMAKE_BUILD_TYPE=${{ matrix.CMAKE_BUILD_TYPE }} \
-DCMAKE_INSTALL_PREFIX="build/distrib" \
-DPACKAGE_NAME="streamfx-${{ matrix.PACKAGE_NAME }}" \
2022-06-13 03:23:15 +00:00
-DPACKAGE_PREFIX="build/package" \
2022-08-03 05:27:35 +00:00
-DENABLE_CLANG=TRUE \
-DENABLE_PROFILING=${ENABLE_PROFILING}
- name: "Validation: clang-tidy"
continue-on-error: true
shell: bash
run: |
cmake --build "build/temp" --config ${{ matrix.CMAKE_BUILD_TYPE }} --target StreamFX_clang-tidy
- name: "Validation: Formatting (clang-format)"
continue-on-error: true
shell: bash
run: |
cmake --build "build/temp" --config ${{ matrix.CMAKE_BUILD_TYPE }} --target StreamFX_clang-format
git --no-pager diff --patch --minimal HEAD --
git update-index --refresh
git diff-index --quiet HEAD --
2022-08-03 05:27:35 +00:00
- name: "Build"
shell: bash
run: |
2022-08-03 05:27:35 +00:00
if [[ "${{ matrix.runner }}" = windows* ]]; then
cmake --build "build/temp" --config RelWithDebInfo --target INSTALL
elif [[ "${{ matrix.runner }}" = ubuntu* ]]; then
cmake --build "build/temp" --config RelWithDebInfo --target install/strip
elif [[ "${{ matrix.runner }}" = macos* ]]; then
cmake --build "build/temp" --config RelWithDebInfo --target install
fi
- name: "Package: Archives"
shell: bash
run: |
mkdir build/package
cmake --build "build/temp" --config RelWithDebInfo --target PACKAGE_7Z
cmake --build "build/temp" --config RelWithDebInfo --target PACKAGE_ZIP
- name: "Package: Installer (Windows)"
if: startsWith( matrix.runner, 'windows' )
shell: cmd
run: |
echo '"C:\Program Files (x86)\Inno Setup 6\ISCC.exe" /V10 ".\build\temp\installer.iss"'
"C:\Program Files (x86)\Inno Setup 6\ISCC.exe" /V10 ".\build\temp\installer.iss"
- name: "Package: Installer (MacOS)"
if: startsWith( matrix.runner, 'macos' )
2021-03-23 20:55:12 +00:00
shell: bash
run: |
packagesbuild ./build/temp/installer.pkgproj
2021-03-23 15:42:34 +00:00
- name: "Artifacts"
uses: actions/upload-artifact@v1
with:
name: ${{ matrix.runner }}-${{ matrix.generator }}-${{ matrix.CMAKE_BUILD_TYPE }}
path: build/package