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-06-02 05:42:04 +00:00
|
|
|
runner: [ windows-2022, ubuntu-22.04, macos-12, windows-2019, ubuntu-20.04, macos-11, macos-10.15 ]
|
2022-06-11 02:46:34 +00:00
|
|
|
generator: [ MSVC, GCC, Clang ]
|
2022-06-02 05:42:04 +00:00
|
|
|
CMAKE_BUILD_TYPE: [ Debug, RelWithDebInfo ]
|
2022-06-11 02:46:34 +00:00
|
|
|
exclude:
|
|
|
|
- runner: windows-2022
|
|
|
|
generator: GCC
|
|
|
|
- runner: windows-2019
|
|
|
|
generator: GCC
|
2022-07-30 23:41:53 +00:00
|
|
|
- runner: windows-2022
|
|
|
|
generator: Clang
|
|
|
|
- runner: windows-2019
|
|
|
|
generator: Clang
|
2022-06-11 02:46:34 +00:00
|
|
|
- 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
|
2020-04-02 18:22:44 +00:00
|
|
|
include:
|
2022-06-02 05:42:04 +00:00
|
|
|
- runner: windows-2022
|
|
|
|
generator: MSVC
|
2022-06-13 01:59:03 +00:00
|
|
|
experimental: true
|
2022-06-02 05:42:04 +00:00
|
|
|
platform: "Windows 11"
|
|
|
|
PACKAGE_NAME: "windows-11"
|
2022-06-11 03:17:14 +00:00
|
|
|
CMAKE_SYSTEM_VERSION: "10.0.22000.0"
|
2022-06-02 05:42:04 +00:00
|
|
|
CMAKE_GENERATOR: "Visual Studio 17 2022"
|
|
|
|
CMAKE_GENERATOR_PLATFORM: "x64"
|
2020-04-02 18:22:44 +00:00
|
|
|
- runner: windows-2019
|
2022-06-02 05:42:04 +00:00
|
|
|
generator: MSVC
|
2022-06-13 01:59:03 +00:00
|
|
|
experimental: false
|
2022-06-02 05:42:04 +00:00
|
|
|
platform: "Windows 10"
|
|
|
|
PACKAGE_NAME: "windows-10"
|
2022-06-11 03:17:14 +00:00
|
|
|
CMAKE_SYSTEM_VERSION: "10.0.19041.0"
|
2022-06-02 05:42:04 +00:00
|
|
|
CMAKE_GENERATOR: "Visual Studio 16 2019"
|
|
|
|
CMAKE_GENERATOR_PLATFORM: "x64"
|
|
|
|
- runner: ubuntu-22.04
|
|
|
|
generator: GCC
|
2022-06-13 01:59:03 +00:00
|
|
|
experimental: false
|
2022-06-02 05:42:04 +00:00
|
|
|
platform: "Ubuntu 22"
|
|
|
|
compiler_c: gcc
|
|
|
|
compiler_cxx: g++
|
|
|
|
PACKAGE_NAME: "ubuntu-22-gcc"
|
|
|
|
CMAKE_GENERATOR: "Ninja"
|
|
|
|
- runner: ubuntu-20.04
|
|
|
|
generator: GCC
|
2022-06-13 01:59:03 +00:00
|
|
|
experimental: false
|
2022-06-02 05:42:04 +00:00
|
|
|
platform: "Ubuntu 20"
|
|
|
|
compiler_c: gcc
|
|
|
|
compiler_cxx: g++
|
|
|
|
PACKAGE_NAME: "ubuntu-20-gcc"
|
|
|
|
CMAKE_GENERATOR: "Ninja"
|
|
|
|
- runner: ubuntu-22.04
|
|
|
|
generator: Clang
|
2022-06-13 01:59:03 +00:00
|
|
|
experimental: false
|
2022-06-02 05:42:04 +00:00
|
|
|
platform: "Ubuntu 22"
|
|
|
|
compiler_c: clang
|
|
|
|
compiler_cxx: clang++
|
|
|
|
PACKAGE_NAME: "ubuntu-22-clang"
|
|
|
|
CMAKE_GENERATOR: "Ninja"
|
|
|
|
- runner: ubuntu-20.04
|
|
|
|
generator: Clang
|
2022-06-13 01:59:03 +00:00
|
|
|
experimental: false
|
2022-06-02 05:42:04 +00:00
|
|
|
platform: "Ubuntu 20"
|
|
|
|
compiler_c: clang
|
|
|
|
compiler_cxx: clang++
|
|
|
|
PACKAGE_NAME: "ubuntu-20-clang"
|
|
|
|
CMAKE_GENERATOR: "Ninja"
|
|
|
|
- runner: macos-12
|
|
|
|
generator: Clang
|
2022-06-13 01:59:03 +00:00
|
|
|
experimental: true
|
2022-06-02 05:42:04 +00:00
|
|
|
platform: "MacOS 12"
|
|
|
|
PACKAGE_NAME: "macos-12"
|
|
|
|
CMAKE_GENERATOR: "Xcode"
|
|
|
|
CMAKE_OSX_DEPLOYMENT_TARGET: "10.15"
|
|
|
|
- runner: macos-11
|
|
|
|
generator: Clang
|
2022-06-13 01:59:03 +00:00
|
|
|
experimental: false
|
2022-06-02 05:42:04 +00:00
|
|
|
platform: "MacOS 11"
|
|
|
|
PACKAGE_NAME: "macos-11"
|
|
|
|
CMAKE_GENERATOR: "Xcode"
|
|
|
|
CMAKE_OSX_DEPLOYMENT_TARGET: "10.15"
|
|
|
|
- runner: macos-10.15
|
|
|
|
generator: Clang
|
2022-06-13 01:59:03 +00:00
|
|
|
experimental: true
|
2022-06-02 05:42:04 +00:00
|
|
|
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 }})"
|
2020-04-02 18:22:44 +00:00
|
|
|
runs-on: ${{ matrix.runner }}
|
2022-06-13 01:59:03 +00:00
|
|
|
continue-on-error: ${{ matrix.experimental }}
|
2020-04-02 18:22:44 +00:00
|
|
|
env:
|
2022-06-02 05:42:04 +00:00
|
|
|
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 }}
|
2022-06-02 05:42:04 +00:00
|
|
|
CMAKE_SYSTEM_VERSION: ${{ matrix.CMAKE_SYSTEM_VERSION }}
|
|
|
|
CMAKE_OSX_DEPLOYMENT_TARGET: "${{ matrix.CMAKE_OSX_DEPLOYMENT_TARGET }}"
|
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-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'
|
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-05-10 17:29:58 +00:00
|
|
|
build/temp/autodeps
|
2022-06-02 05:42:04 +00:00
|
|
|
key: autodeps-${{ matrix.runner }}-${{ matrix.generator }}-${{ matrix.CMAKE_BUILD_TYPE }}-${{ env.CACHE_VERSION }}
|
2022-05-10 17:29:58 +00:00
|
|
|
|
2022-07-30 23:41:53 +00:00
|
|
|
- name: "Code Signing (Windows)" # Do not run this on pull requests, ever!
|
2022-06-02 05:42:04 +00:00
|
|
|
if: (github.event_name != 'pull_request') && startsWith( matrix.runner, 'windows' )
|
|
|
|
id: codesign
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
# Restore the Certificate back into a file.
|
|
|
|
echo "${{ secrets.CODESIGN_CERT_WIN }}" | base64 --decode > "${{ github.workspace }}/cert.pfx"
|
|
|
|
echo "::set-output name=cmake_args::-DENABLE_CODESIGN=ON -DCODESIGN_TIMESTAMPS=ON"
|
|
|
|
|
|
|
|
- name: "Configure"
|
2021-02-18 22:13:43 +00:00
|
|
|
shell: bash
|
2022-06-02 05:42:04 +00:00
|
|
|
env:
|
|
|
|
CODESIGN_FILE: ${{ github.workspace }}/cert.pfx
|
|
|
|
CODESIGN_PASS: ${{ secrets.CODESIGN_CERT_WIN_PASSWORD }}
|
2021-02-18 22:13:43 +00:00
|
|
|
run: |
|
2022-08-03 05:27:35 +00:00
|
|
|
if [[ "${{ matrix.CMAKE_BUILD_TYPE }}" = "Debug" ]]; then
|
|
|
|
ENABLE_PROFILING=ON
|
|
|
|
else
|
|
|
|
ENABLE_PROFILING=OFF
|
|
|
|
fi
|
2021-02-18 22:13:43 +00:00
|
|
|
cmake -H. -B"build/temp" \
|
2022-06-02 05:42:04 +00:00
|
|
|
${{ steps.codesign.outputs.cmake_args }} \
|
|
|
|
-DCMAKE_BUILD_TYPE=${{ matrix.CMAKE_BUILD_TYPE }} \
|
2021-02-18 22:13:43 +00:00
|
|
|
-DCMAKE_INSTALL_PREFIX="build/distrib" \
|
2022-06-02 05:42:04 +00:00
|
|
|
-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}
|
2022-05-10 17:29:58 +00:00
|
|
|
|
2022-08-03 05:33:16 +00:00
|
|
|
- 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"
|
2021-02-18 22:13:43 +00:00
|
|
|
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
|
2022-05-10 17:29:58 +00:00
|
|
|
|
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
|
|
|
|
cmake --build "build/temp" --config RelWithDebInfo --target PACKAGE_7Z
|
|
|
|
cmake --build "build/temp" --config RelWithDebInfo --target PACKAGE_ZIP
|
2022-05-10 17:29:58 +00:00
|
|
|
|
2022-06-02 05:42:04 +00:00
|
|
|
- name: "Package: Installer Code Signing (Windows)"
|
|
|
|
if: (github.event_name != 'pull_request') && startsWith( matrix.runner, 'windows' )
|
|
|
|
id: codesign_install
|
2021-03-23 20:55:12 +00:00
|
|
|
shell: bash
|
|
|
|
run: |
|
2022-06-02 05:42:04 +00:00
|
|
|
if [[ -f "${{ github.workspace }}/cert.pfx" ]]; then
|
|
|
|
signtool=$(awk 'match($0, /^;signtool=(.+)$/, ary) {print ary[1]}' "${{ github.workspace }}/build/temp/installer.iss")
|
|
|
|
echo "::set-output name=iscc_signtool::${signtool}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
- name: "Package: Installer (Windows)"
|
|
|
|
if: startsWith( matrix.runner, 'windows' )
|
|
|
|
shell: cmd
|
|
|
|
run: |
|
|
|
|
echo '"C:\Program Files (x86)\Inno Setup 6\ISCC.exe" /V10 "/Ssigntool=${{ steps.codesign_install.outputs.iscc_signtool }} $p" ".\build\temp\installer.iss"'
|
|
|
|
"C:\Program Files (x86)\Inno Setup 6\ISCC.exe" /V10 "/Ssigntool=${{ steps.codesign_install.outputs.iscc_signtool }} $p" ".\build\temp\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: |
|
|
|
|
packagesbuild ./build/temp/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
|