Skip to content

CI: Made presets compatible with earlier versions of cmake #12

CI: Made presets compatible with earlier versions of cmake

CI: Made presets compatible with earlier versions of cmake #12

Workflow file for this run

name: Build
on:
schedule:
- cron: '* 0 * * *'
push:
workflow_dispatch:
env:
BUILD_CONFIG: Release
BUILD_DIR: build
jobs:
test:
strategy:
fail-fast: false
matrix:
name: [ linux, macOS, windows ]
target: [ DemoRunner, TestRunner, Benchmarks, EngineInPluginDemo ]
include:
- name: linux
os: ubuntu-latest
config_preset: "ninja-multi"
build_preset: "ninja"
cmake_host_system_name: "Linux"
- name: macOS
os: macos-latest
config_preset: "xcode"
build_preset: "xcode"
cmake_host_system_name: "Darwin"
- name: windows
os: windows-latest
config_preset: "windows"
build_preset: "windows"
cmake_host_system_name: "Windows"
- publish_benchmark: true
runs-on: ${{ matrix.os }}
steps:
# Install dependencies
- name: Install dependencies
if: ${{ matrix.name == 'linux' }}
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install -y gcc-11 g++-11 freeglut3-dev g++ libasound2-dev libcurl4-openssl-dev libfreetype6-dev libjack-jackd2-dev libx11-dev libxcomposite-dev libxcursor-dev libxinerama-dev libxrandr-dev mesa-common-dev ladspa-sdk webkit2gtk-4.0 libgtk-3-dev xvfb ninja-build
- name: Set Xcode version
if: runner.os == 'macOS'
run: sudo xcode-select -s /Applications/Xcode_15.3.app
- uses: actions/checkout@v4
with:
submodules: true
- name: Add Rubber Band submodule for testing
run: |
git submodule add -f /~https://github.com/breakfastquay/rubberband.git modules/3rd_party/rubberband
git submodule update --init
# Setup Environment Variables
- name: Setup Environment Variables
shell: bash
run: |
pwd
ls -la
VERSION=$(cat VERSION.md)
echo "VERSION=$VERSION" >> $GITHUB_ENV
TARGET=${{ matrix.target }}
CONFIG_PRESET=${{ matrix.config_preset }}
TEST_DIR=cmake-build/${{ matrix.cmake_host_system_name }}/cmake-$CONFIG_PRESET
echo "TEST_DIR=$TEST_DIR" >> $GITHUB_ENV
# Generate build files
- name: "Generate Build Files"
id: generate
shell: bash
run: |
cmake --preset ${{ matrix.config_preset }}
# Build products
- name: "Build products"
shell: bash
if: ${{ ! matrix.analyse }}
run: |
if [[ "$OSTYPE" == "linux-gnu" ]]; then
export DISABLE_VALGRIND=1
export CC=/usr/bin/gcc-11
export CXX=/usr/bin/g++-11
gcc -v
g++ -v
fi
cmake --build --preset ${{ matrix.build_preset }}-${{ env.BUILD_CONFIG }} --target ${{ matrix.target }}
# Run products
- name: "Run products"
if: ${{ ! matrix.analyse }}
shell: bash
env:
BM_API_KEY: ${{ matrix.publish_benchmark && secrets.BM_API_KEY || '' }}
BM_BRANCH_NAME: ${{ github.ref }}
run: |
ROOT=$(pwd)
echo $ROOT
ctest --test-dir ${{ env.TEST_DIR }} -C ${{ env.BUILD_CONFIG }} -R ${{ matrix.target }} -V
# Static analyse
- name: "Static analyse products"
shell: bash
if: ${{ matrix.analyse }}
run: |
cd ${{ env.BUILD_DIR }}
OUTPUT=`xcodebuild analyze -quiet -target ${{ matrix.target }} -configuration ${{ env.BUILD_CONFIG }} LLVM_LTO=NO`
echo "$OUTPUT"
WARNING_LINES=$(echo "$OUTPUT" | grep ": warning:")
TRACKTION_WARNING_LINES=$(echo "$WARNING_LINES" | sed -n '/tracktion_engine\/modules\/tracktion_/p')
TRACKTION_ONLY_WARNING_LINES=$(echo "$TRACKTION_WARNING_LINES" | sed '/\/3rd_party\//d')
echo "TRACKTION_ONLY_WARNING_LINES:\n"
echo "$TRACKTION_ONLY_WARNING_LINES"
if [[ "$TRACKTION_ONLY_WARNING_LINES" != "" ]]; then exit 1; fi