2021-03-02 02:36:10 +00:00
|
|
|
name: Build
|
|
|
|
|
2021-03-05 14:00:07 +00:00
|
|
|
on:
|
|
|
|
push:
|
2021-06-12 04:13:57 +00:00
|
|
|
branches-ignore:
|
|
|
|
- main
|
2021-03-19 14:47:53 +00:00
|
|
|
paths-ignore:
|
|
|
|
- '*.json'
|
|
|
|
- '*.md'
|
|
|
|
- '*LICENSE'
|
2021-04-06 19:20:29 +00:00
|
|
|
pull_request:
|
2021-03-02 02:36:10 +00:00
|
|
|
|
2021-06-12 01:19:33 +00:00
|
|
|
env:
|
2021-10-26 02:36:26 +00:00
|
|
|
BUILDCACHE_VERSION: v0.27.3
|
2021-06-12 01:19:33 +00:00
|
|
|
BUILDCACHE_ACCURACY: STRICT
|
|
|
|
BUILDCACHE_MAX_CACHE_SIZE: 1073741824 # 1GiB
|
|
|
|
|
2021-03-02 02:36:10 +00:00
|
|
|
jobs:
|
2021-03-19 14:47:53 +00:00
|
|
|
build-linux:
|
|
|
|
name: Build Linux (${{matrix.name}} x86_64)
|
2021-03-02 02:36:10 +00:00
|
|
|
runs-on: ubuntu-20.04
|
2021-06-12 01:19:33 +00:00
|
|
|
|
|
|
|
env:
|
|
|
|
BUILDCACHE_DIR: ${{github.workspace}}/.buildcache
|
|
|
|
|
2021-03-19 14:47:53 +00:00
|
|
|
strategy:
|
2021-04-05 21:04:50 +00:00
|
|
|
fail-fast: false
|
2021-03-19 14:47:53 +00:00
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- name: GCC
|
2021-06-10 04:30:31 +00:00
|
|
|
preset: gcc
|
2021-03-19 14:47:53 +00:00
|
|
|
- name: Clang
|
2021-06-10 04:30:31 +00:00
|
|
|
preset: clang
|
2021-03-07 20:42:48 +00:00
|
|
|
|
2021-03-02 02:36:10 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
2021-03-29 22:32:55 +00:00
|
|
|
fetch-depth: 0
|
2021-03-02 02:36:10 +00:00
|
|
|
submodules: recursive
|
2021-03-07 20:42:48 +00:00
|
|
|
|
2021-03-02 02:36:10 +00:00
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
2021-04-18 15:19:09 +00:00
|
|
|
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
|
|
|
|
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
|
|
|
|
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
|
|
|
|
sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
|
2021-06-12 02:57:38 +00:00
|
|
|
sudo apt-get -y install ninja-build clang lld libcurl4-openssl-dev intel-oneapi-ipp-devel \
|
2021-04-04 22:39:07 +00:00
|
|
|
zlib1g-dev libglu1-mesa-dev libdbus-1-dev libvulkan-dev libxi-dev libxrandr-dev libasound2-dev \
|
2022-02-09 06:39:54 +00:00
|
|
|
libpulse-dev libudev-dev libpng-dev libncurses5-dev libx11-xcb-dev qt5-default libfreetype-dev
|
2021-04-18 15:19:09 +00:00
|
|
|
|
|
|
|
yarn global add @sentry/cli
|
|
|
|
echo "$(yarn global bin)" >> $GITHUB_PATH
|
2021-05-02 17:22:49 +00:00
|
|
|
|
2021-06-12 01:19:33 +00:00
|
|
|
# setup buildcache
|
2021-10-26 02:36:26 +00:00
|
|
|
curl -LSfs https://github.com/encounter/buildcache/releases/download/$BUILDCACHE_VERSION/buildcache-linux.tar.gz | tar xz -C "$RUNNER_WORKSPACE"
|
2021-06-12 01:19:33 +00:00
|
|
|
echo "$RUNNER_WORKSPACE"/buildcache/bin >> $GITHUB_PATH
|
|
|
|
|
2021-03-19 14:47:53 +00:00
|
|
|
# free up disk space
|
|
|
|
# https://github.com/actions/virtual-environments/issues/2840#issuecomment-790492173
|
|
|
|
echo Before
|
|
|
|
df -h .
|
|
|
|
sudo apt-get clean
|
|
|
|
sudo rm -rf /usr/share/dotnet
|
|
|
|
sudo rm -rf /opt/ghc
|
|
|
|
sudo rm -rf /usr/local/share/boost
|
|
|
|
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
|
|
|
|
echo After
|
|
|
|
df -h .
|
2021-03-07 20:42:48 +00:00
|
|
|
|
2021-06-12 01:19:33 +00:00
|
|
|
- name: Restore buildcache
|
2021-06-12 14:35:07 +00:00
|
|
|
uses: pat-s/always-upload-cache@v2
|
2021-04-18 15:19:09 +00:00
|
|
|
with:
|
2021-06-12 01:19:33 +00:00
|
|
|
path: ${{env.BUILDCACHE_DIR}}
|
2021-06-12 02:38:29 +00:00
|
|
|
key: buildcache-${{runner.os}}-${{matrix.preset}}-${{github.sha}}
|
|
|
|
restore-keys: |
|
|
|
|
buildcache-${{runner.os}}-${{matrix.preset}}-
|
2021-06-11 23:52:19 +00:00
|
|
|
|
2021-03-02 02:36:10 +00:00
|
|
|
- name: Configure CMake
|
2021-06-12 01:19:33 +00:00
|
|
|
run: cmake --preset x-linux-ci-${{matrix.preset}}
|
2021-03-07 20:42:48 +00:00
|
|
|
|
2021-03-02 02:36:10 +00:00
|
|
|
- name: Build
|
2021-06-12 01:19:33 +00:00
|
|
|
run: cmake --build --preset x-linux-ci-${{matrix.preset}}
|
|
|
|
|
|
|
|
- name: Print buildcache stats
|
|
|
|
run: buildcache -s
|
2021-03-07 20:42:48 +00:00
|
|
|
|
2021-03-02 02:36:10 +00:00
|
|
|
build-macos:
|
2021-04-13 14:42:01 +00:00
|
|
|
name: Build macOS (AppleClang universal)
|
2021-10-26 15:38:01 +00:00
|
|
|
runs-on: macos-11
|
2021-06-12 01:19:33 +00:00
|
|
|
|
2021-04-18 15:19:09 +00:00
|
|
|
env:
|
|
|
|
Qt_VERSION: 5.15.2
|
|
|
|
IPP_VERSION: 2021.2.0.192
|
2021-06-12 01:21:39 +00:00
|
|
|
BUILDCACHE_DIR: ${{github.workspace}}/.buildcache
|
2021-06-12 01:19:33 +00:00
|
|
|
|
2021-03-02 02:36:10 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
2021-03-29 22:32:55 +00:00
|
|
|
fetch-depth: 0
|
2021-03-02 02:36:10 +00:00
|
|
|
submodules: recursive
|
2021-03-07 20:42:48 +00:00
|
|
|
|
2021-03-02 02:36:10 +00:00
|
|
|
- name: Install dependencies
|
2021-03-19 19:01:26 +00:00
|
|
|
run: |
|
2021-04-12 16:29:10 +00:00
|
|
|
brew update
|
2021-05-02 04:04:14 +00:00
|
|
|
brew upgrade --formula
|
2022-02-09 06:39:54 +00:00
|
|
|
brew install ninja graphicsmagick imagemagick freetype
|
2021-03-19 19:01:26 +00:00
|
|
|
yarn global add create-dmg
|
2021-06-12 01:19:33 +00:00
|
|
|
|
2021-04-13 14:42:01 +00:00
|
|
|
# universal qt5 from macports
|
2021-04-18 15:30:33 +00:00
|
|
|
curl -LSfs https://axiodl.com/files/qt-$Qt_VERSION.mpkg -o /tmp/qt-$Qt_VERSION.mpkg
|
|
|
|
sudo installer -pkg /tmp/qt-$Qt_VERSION.mpkg -target /
|
2021-06-12 14:02:12 +00:00
|
|
|
echo /opt/local/libexec/qt5/bin >> $GITHUB_PATH
|
2021-03-07 20:42:48 +00:00
|
|
|
|
2021-06-12 01:19:33 +00:00
|
|
|
# setup buildcache
|
2021-10-26 02:36:26 +00:00
|
|
|
curl -LSfs https://github.com/encounter/buildcache/releases/download/$BUILDCACHE_VERSION/buildcache-macos.zip -o /tmp/buildcache-macos.zip
|
2021-06-12 01:19:33 +00:00
|
|
|
unzip /tmp/buildcache-macos.zip -d "$RUNNER_WORKSPACE"
|
|
|
|
echo "$RUNNER_WORKSPACE"/buildcache/bin >> $GITHUB_PATH
|
|
|
|
|
2021-04-18 15:19:09 +00:00
|
|
|
- name: Install Intel IPP
|
2021-04-19 01:39:09 +00:00
|
|
|
if: 'false' # not supported for universal build
|
2021-04-18 15:19:09 +00:00
|
|
|
run: |
|
|
|
|
NAME="m_ipp_oneapi_p_${IPP_VERSION}_offline"
|
|
|
|
curl -LSfs https://registrationcenter-download.intel.com/akdlm/irc_nas/17606/$NAME.dmg -o /tmp/$NAME.dmg
|
|
|
|
sudo hdiutil attach /tmp/$NAME.dmg -quiet
|
|
|
|
sudo /Volumes/$NAME/bootstrapper.app/Contents/MacOS/install.sh -c --action install --eula accept
|
|
|
|
sudo hdiutil detach /Volumes/$NAME -quiet
|
|
|
|
rm /tmp/$NAME.dmg
|
|
|
|
|
2021-06-12 01:19:33 +00:00
|
|
|
- name: Restore buildcache
|
2021-06-12 14:35:07 +00:00
|
|
|
uses: pat-s/always-upload-cache@v2
|
2021-04-18 15:19:09 +00:00
|
|
|
with:
|
2021-06-12 01:19:33 +00:00
|
|
|
path: ${{env.BUILDCACHE_DIR}}
|
2021-06-12 02:38:29 +00:00
|
|
|
key: buildcache-${{runner.os}}-universal-${{github.sha}}
|
|
|
|
restore-keys: |
|
|
|
|
buildcache-${{runner.os}}-universal-
|
2021-03-07 20:42:48 +00:00
|
|
|
|
2021-03-02 02:36:10 +00:00
|
|
|
- name: Configure CMake
|
2021-06-12 01:19:33 +00:00
|
|
|
run: cmake --preset x-macos-ci
|
2021-03-07 20:42:48 +00:00
|
|
|
|
2021-03-02 02:36:10 +00:00
|
|
|
- name: Build
|
2021-06-12 01:19:33 +00:00
|
|
|
run: cmake --build --preset x-macos-ci
|
|
|
|
|
|
|
|
- name: Print buildcache stats
|
|
|
|
run: buildcache -s
|
2021-04-13 14:42:01 +00:00
|
|
|
|
2021-06-10 04:30:31 +00:00
|
|
|
build-windows:
|
|
|
|
name: Build Windows (${{matrix.name}} x86_64)
|
2021-04-06 19:20:29 +00:00
|
|
|
runs-on: windows-2019
|
2021-06-11 23:52:19 +00:00
|
|
|
|
2021-03-08 01:40:00 +00:00
|
|
|
env:
|
2021-03-13 14:41:14 +00:00
|
|
|
Qt_VERSION: 5.15.2
|
2021-04-06 19:20:29 +00:00
|
|
|
IPP_VERSION: 2021.2.0.210
|
2021-04-18 15:19:09 +00:00
|
|
|
# C: has ~90GB available space at the moment
|
|
|
|
BUILDCACHE_DIR: C:\buildcache
|
|
|
|
BUILD_DIR: C:\build
|
2021-06-11 23:52:19 +00:00
|
|
|
|
2021-06-10 04:30:31 +00:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
include:
|
2021-06-12 04:13:57 +00:00
|
|
|
# Disabled due to memory constraints
|
|
|
|
# - name: MSVC
|
|
|
|
# preset: msvc
|
2021-06-10 04:30:31 +00:00
|
|
|
- name: Clang
|
|
|
|
preset: clang
|
2021-03-07 20:42:48 +00:00
|
|
|
|
2021-03-02 02:36:10 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
2021-03-29 22:32:55 +00:00
|
|
|
fetch-depth: 0
|
2021-03-02 02:36:10 +00:00
|
|
|
submodules: recursive
|
2021-03-07 20:42:48 +00:00
|
|
|
|
2021-03-13 16:58:20 +00:00
|
|
|
- name: Install vcpkg Qt
|
|
|
|
run: |
|
|
|
|
$TempDir = "$env:RUNNER_WORKSPACE\temp"
|
2021-06-12 01:19:33 +00:00
|
|
|
$Filename = "vcpkg-qt-$env:Qt_VERSION-full.7z"
|
2021-03-13 16:58:20 +00:00
|
|
|
New-Item -Path "$TempDir" -ItemType Directory -ea 0
|
|
|
|
(New-Object Net.WebClient).DownloadFile("https://axiodl.com/files/$Filename", "$TempDir\$Filename")
|
|
|
|
7z x "-o$env:RUNNER_WORKSPACE" -aos "$TempDir\$Filename"
|
2021-03-10 20:36:19 +00:00
|
|
|
|
2021-04-18 15:19:09 +00:00
|
|
|
- name: Install Intel IPP
|
2021-06-12 01:50:57 +00:00
|
|
|
if: 'false' # takes >10min, not worth it
|
2021-03-13 16:58:20 +00:00
|
|
|
run: |
|
|
|
|
$TempDir = "$env:RUNNER_WORKSPACE\temp"
|
2021-04-18 15:19:09 +00:00
|
|
|
$Filename = "w_ipp_oneapi_p_${env:IPP_VERSION}_offline.exe"
|
2021-03-13 16:58:20 +00:00
|
|
|
New-Item -Path "$TempDir" -ItemType Directory -ea 0
|
2021-04-18 15:19:09 +00:00
|
|
|
(New-Object Net.WebClient).DownloadFile("https://registrationcenter-download.intel.com/akdlm/irc_nas/17739/$Filename", "$TempDir\$Filename")
|
|
|
|
Start-Process "$TempDir\$Filename" -ArgumentList "--x --s --f $TempDir\ipp" -Wait
|
|
|
|
Start-Process "$TempDir\ipp\bootstrapper.exe" -ArgumentList "--eula accept -c --action install" -Wait
|
2021-03-08 01:16:26 +00:00
|
|
|
|
|
|
|
- name: Install dependencies
|
2021-03-13 16:58:20 +00:00
|
|
|
run: |
|
2021-04-18 15:19:09 +00:00
|
|
|
choco install ninja vulkan-sdk
|
|
|
|
|
|
|
|
# set up buildcache
|
2021-03-13 16:58:20 +00:00
|
|
|
$TempDir = "$env:RUNNER_WORKSPACE\temp"
|
|
|
|
New-Item -Path "$TempDir" -ItemType Directory -ea 0
|
2021-10-26 02:36:26 +00:00
|
|
|
(New-Object Net.WebClient).DownloadFile("https://github.com/encounter/buildcache/releases/download/$env:BUILDCACHE_VERSION/buildcache-windows.zip", "$TempDir\buildcache.zip")
|
2021-06-12 14:04:28 +00:00
|
|
|
Expand-Archive -LiteralPath "$TempDir\buildcache.zip" -DestinationPath "$TempDir" -Force
|
2021-04-18 15:19:09 +00:00
|
|
|
echo "$TempDir\buildcache\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
2021-03-08 01:16:26 +00:00
|
|
|
|
2021-04-18 15:19:09 +00:00
|
|
|
# check available disk space
|
|
|
|
Get-PSDrive
|
|
|
|
|
|
|
|
- name: Restore buildcache
|
2021-06-12 14:35:07 +00:00
|
|
|
uses: pat-s/always-upload-cache@v2
|
2021-04-18 15:19:09 +00:00
|
|
|
with:
|
|
|
|
path: ${{env.BUILDCACHE_DIR}}
|
2021-06-12 02:38:29 +00:00
|
|
|
key: buildcache-${{runner.os}}-${{matrix.preset}}-${{github.sha}}
|
|
|
|
restore-keys: |
|
|
|
|
buildcache-${{runner.os}}-${{matrix.preset}}-
|
2021-03-07 20:42:48 +00:00
|
|
|
|
2021-03-05 14:00:07 +00:00
|
|
|
- name: Enable Visual Studio environment
|
|
|
|
uses: ilammy/msvc-dev-cmd@v1
|
2021-03-07 20:42:48 +00:00
|
|
|
|
2021-03-02 02:36:10 +00:00
|
|
|
- name: Configure CMake
|
2021-06-12 01:19:33 +00:00
|
|
|
run: cmake --preset x-windows-ci-${{matrix.preset}}
|
2021-04-06 22:15:33 +00:00
|
|
|
|
|
|
|
- name: Build
|
2021-06-12 01:19:33 +00:00
|
|
|
run: cmake --build --preset x-windows-ci-${{matrix.preset}}
|
2021-04-18 15:19:09 +00:00
|
|
|
|
|
|
|
- name: Print buildcache stats
|
|
|
|
run: buildcache -s
|