2020-04-02 18:22:44 +00:00
|
|
|
name: Build
|
2019-09-03 19:18:14 +00:00
|
|
|
|
2021-03-22 21:30:05 +00:00
|
|
|
on:
|
2020-04-23 23:55:40 +00:00
|
|
|
push:
|
2021-10-05 20:10:25 +00:00
|
|
|
branches:
|
|
|
|
- 'master'
|
2020-09-25 19:06:59 +00:00
|
|
|
tags:
|
|
|
|
- '*'
|
2020-04-23 23:55:40 +00:00
|
|
|
pull_request:
|
2020-04-24 04:18:40 +00:00
|
|
|
branches:
|
|
|
|
- '*'
|
2019-09-03 19:18:14 +00:00
|
|
|
|
2022-06-02 05:42:04 +00:00
|
|
|
concurrency:
|
|
|
|
group: build-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2020-11-02 15:52:21 +00:00
|
|
|
env:
|
2022-06-02 05:42:04 +00:00
|
|
|
CACHE_VERSION: 2
|
2021-10-17 06:20:16 +00:00
|
|
|
LIBAOM_VERSION: "3.2.0.0"
|
2020-11-02 15:52:21 +00:00
|
|
|
|
2019-09-03 19:18:14 +00:00
|
|
|
jobs:
|
2022-06-02 05:42:04 +00:00
|
|
|
build:
|
2020-04-02 18:22:44 +00:00
|
|
|
strategy:
|
2022-06-11 03:25:29 +00:00
|
|
|
fail-fast: false
|
2021-03-22 21:30:05 +00:00
|
|
|
matrix:
|
2022-08-13 14:49:08 +00:00
|
|
|
runner: [ windows-2022, macos-12, ubuntu-22.04, ubuntu-20.04 ]
|
2022-06-11 02:46:34 +00:00
|
|
|
generator: [ MSVC, GCC, Clang ]
|
|
|
|
exclude:
|
|
|
|
- runner: windows-2022
|
|
|
|
generator: GCC
|
2022-07-30 23:41:53 +00:00
|
|
|
- runner: windows-2022
|
|
|
|
generator: Clang
|
2022-06-11 02:46:34 +00:00
|
|
|
- runner: macos-12
|
|
|
|
generator: MSVC
|
|
|
|
- runner: macos-12
|
|
|
|
generator: GCC
|
2022-08-13 14:49:08 +00:00
|
|
|
- runner: ubuntu-22.04
|
2022-06-11 02:46:34 +00:00
|
|
|
generator: MSVC
|
2022-08-13 14:49:08 +00:00
|
|
|
- runner: ubuntu-20.04
|
2022-06-11 02:46:34 +00:00
|
|
|
generator: MSVC
|
2020-04-02 18:22:44 +00:00
|
|
|
include:
|
2022-08-13 14:49:08 +00:00
|
|
|
# Windows supports MSVC
|
2022-06-02 05:42:04 +00:00
|
|
|
- runner: windows-2022
|
2022-08-13 14:49:08 +00:00
|
|
|
name: "Windows"
|
|
|
|
package_name: "windows"
|
|
|
|
CMAKE_SYSTEM_VERSION: "10.0.20348.0"
|
2022-06-02 05:42:04 +00:00
|
|
|
CMAKE_GENERATOR: "Visual Studio 17 2022"
|
|
|
|
CMAKE_GENERATOR_PLATFORM: "x64"
|
2022-08-13 14:49:08 +00:00
|
|
|
|
|
|
|
# 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
|
2022-06-02 05:42:04 +00:00
|
|
|
- runner: ubuntu-22.04
|
2022-08-13 14:49:08 +00:00
|
|
|
name: "Ubuntu 22.04"
|
|
|
|
package_name: "ubuntu-22"
|
2022-06-02 05:42:04 +00:00
|
|
|
CMAKE_GENERATOR: "Ninja"
|
|
|
|
- runner: ubuntu-20.04
|
2022-08-13 14:49:08 +00:00
|
|
|
name: "Ubuntu 20.04"
|
|
|
|
package_name: "ubuntu-20"
|
2022-06-02 05:42:04 +00:00
|
|
|
CMAKE_GENERATOR: "Ninja"
|
2022-08-13 14:49:08 +00:00
|
|
|
|
2020-04-02 18:22:44 +00:00
|
|
|
runs-on: ${{ matrix.runner }}
|
2022-08-13 14:49:08 +00:00
|
|
|
name: "${{ matrix.name }} (${{ matrix.generator }})"
|
2020-04-02 18:22:44 +00:00
|
|
|
env:
|
2022-08-13 14:49:08 +00:00
|
|
|
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 }}"
|
2022-06-02 05:42:04 +00:00
|
|
|
CMAKE_OSX_DEPLOYMENT_TARGET: "${{ matrix.CMAKE_OSX_DEPLOYMENT_TARGET }}"
|
2022-08-13 14:49:08 +00:00
|
|
|
CMAKE_OSX_ARCHITECTURES: "${{ matrix.CMAKE_OSX_ARCHITECTURES }}"
|
2020-02-13 09:11:33 +00:00
|
|
|
steps:
|
2021-03-23 15:42:34 +00:00
|
|
|
- name: "Clone"
|
2022-06-02 05:42:04 +00:00
|
|
|
uses: actions/checkout@v3
|
2021-02-18 22:13:43 +00:00
|
|
|
with:
|
|
|
|
submodules: recursive
|
2021-03-23 15:42:34 +00:00
|
|
|
fetch-depth: 0
|
2022-05-10 17:29:58 +00:00
|
|
|
|
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"
|
2022-06-02 05:42:04 +00:00
|
|
|
if: startsWith( matrix.runner, 'ubuntu' )
|
2020-04-02 18:22:44 +00:00
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
sudo apt-get -qq update
|
2020-04-24 01:09:59 +00:00
|
|
|
sudo apt-get purge libjpeg9-dev:amd64 libjpeg8-dev:amd64 libjpeg-turbo8-dev:amd64
|
2020-04-02 22:17:36 +00:00
|
|
|
sudo apt-get install \
|
2020-04-24 01:09:59 +00:00
|
|
|
build-essential \
|
2021-08-28 12:36:42 +00:00
|
|
|
checkinstall \
|
|
|
|
pkg-config \
|
2020-04-02 22:17:36 +00:00
|
|
|
cmake \
|
|
|
|
ninja-build \
|
|
|
|
git \
|
2022-06-02 05:42:04 +00:00
|
|
|
qtbase5-dev qtbase5-private-dev libqt5svg5-dev \
|
2020-09-09 03:06:15 +00:00
|
|
|
libavcodec-dev libavdevice-dev libavfilter-dev libavformat-dev libavutil-dev libswresample-dev libswscale-dev \
|
2021-08-28 12:36:42 +00:00
|
|
|
libcurl4-openssl-dev
|
2022-08-13 14:49:08 +00:00
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
|
|
# Compiler
|
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
|
2022-08-13 14:49:08 +00:00
|
|
|
echo "CC=gcc-10" >> "${GITHUB_ENV}"
|
|
|
|
echo "CXX=gcc-10" >> "${GITHUB_ENV}"
|
|
|
|
echo "LD=ld" >> "${GITHUB_ENV}"
|
2022-08-03 05:27:35 +00:00
|
|
|
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
|
2022-08-13 14:49:08 +00:00
|
|
|
echo "CC=clang-14" >> "${GITHUB_ENV}"
|
|
|
|
echo "CXX=clang++-14" >> "${GITHUB_ENV}"
|
|
|
|
echo "LD=lld" >> "${GITHUB_ENV}"
|
2022-08-03 05:27:35 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
- name: 'Dependencies: MacOS'
|
2022-06-02 05:42:04 +00:00
|
|
|
if: startsWith( matrix.runner, 'macos' )
|
2020-02-13 09:11:33 +00:00
|
|
|
shell: bash
|
|
|
|
run: |
|
2022-06-02 05:42:04 +00:00
|
|
|
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 /
|
2021-08-28 12:36:42 +00:00
|
|
|
|
2022-06-02 05:42:04 +00:00
|
|
|
- name: "Auto-Dependency Cache"
|
|
|
|
if: github.event_name != 'pull_request'
|
|
|
|
uses: actions/cache@v3
|
2021-03-23 15:42:34 +00:00
|
|
|
with:
|
|
|
|
path: |
|
2022-08-13 14:49:08 +00:00
|
|
|
build/debug/autodeps
|
|
|
|
build/release/autodeps
|
|
|
|
key: autodeps-${{ matrix.runner }}-${{ matrix.generator }}-${{ env.CACHE_VERSION }}
|
2022-05-10 17:29:58 +00:00
|
|
|
|
2022-08-13 14:49:08 +00:00
|
|
|
- name: "Configure & Build (Debug)"
|
|
|
|
continue-on-error: true
|
2021-02-18 22:13:43 +00:00
|
|
|
shell: bash
|
|
|
|
run: |
|
2022-08-13 14:49:08 +00:00
|
|
|
cmake -H. -B"build/debug" \
|
|
|
|
-DCMAKE_BUILD_TYPE=Debug \
|
|
|
|
-DCMAKE_INSTALL_PREFIX="build/debug/install" \
|
|
|
|
-DPACKAGE_NAME="streamfx-${{ matrix.package_name }}-debug" \
|
2022-06-13 03:23:15 +00:00
|
|
|
-DPACKAGE_PREFIX="build/package" \
|
2022-08-03 05:27:35 +00:00
|
|
|
-DENABLE_CLANG=TRUE \
|
2022-08-13 14:49:08 +00:00
|
|
|
-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
|
|
|
|
cmake --build "build/debug" --config Debug --target StreamFX_clang-format
|
2022-05-10 17:29:58 +00:00
|
|
|
|
2022-08-13 14:49:08 +00:00
|
|
|
- name: "Configure & Build (Release)"
|
2022-08-03 05:33:16 +00:00
|
|
|
shell: bash
|
|
|
|
run: |
|
2022-08-13 14:49:08 +00:00
|
|
|
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 \
|
|
|
|
-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
|
|
|
|
cmake --build "build/release" --config RelWithDebInfo --target StreamFX_clang-format
|
2022-08-03 05:33:16 +00:00
|
|
|
|
2022-08-13 14:49:08 +00:00
|
|
|
- name: "Validate Formatting"
|
|
|
|
continue-on-error: false
|
2022-08-03 05:33:16 +00:00
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
git --no-pager diff --patch --minimal HEAD --
|
|
|
|
git update-index --refresh
|
|
|
|
git diff-index --quiet HEAD --
|
|
|
|
|
2022-06-02 05:42:04 +00:00
|
|
|
- name: "Package: Archives"
|
2021-02-18 22:13:43 +00:00
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
mkdir build/package
|
2022-08-13 14:49:08 +00:00
|
|
|
cmake --build "build/debug" --config RelWithDebInfo --target PACKAGE_7Z
|
|
|
|
cmake --build "build/release" --config RelWithDebInfo --target PACKAGE_7Z
|
2022-05-10 17:29:58 +00:00
|
|
|
|
2022-06-02 05:42:04 +00:00
|
|
|
- name: "Package: Installer (Windows)"
|
|
|
|
if: startsWith( matrix.runner, 'windows' )
|
|
|
|
shell: cmd
|
|
|
|
run: |
|
2022-08-13 14:49:08 +00:00
|
|
|
"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"
|
2022-05-10 17:29:58 +00:00
|
|
|
|
2022-06-02 05:42:04 +00:00
|
|
|
- name: "Package: Installer (MacOS)"
|
|
|
|
if: startsWith( matrix.runner, 'macos' )
|
2021-03-23 20:55:12 +00:00
|
|
|
shell: bash
|
|
|
|
run: |
|
2022-08-13 14:49:08 +00:00
|
|
|
packagesbuild ./build/debug/installer.pkgproj
|
|
|
|
packagesbuild ./build/release/installer.pkgproj
|
2022-05-10 17:29:58 +00:00
|
|
|
|
2021-03-23 15:42:34 +00:00
|
|
|
- name: "Artifacts"
|
2021-02-18 22:13:43 +00:00
|
|
|
uses: actions/upload-artifact@v1
|
|
|
|
with:
|
2022-06-02 05:42:04 +00:00
|
|
|
name: ${{ matrix.runner }}-${{ matrix.generator }}-${{ matrix.CMAKE_BUILD_TYPE }}
|
2021-02-18 22:13:43 +00:00
|
|
|
path: build/package
|