-
Notifications
You must be signed in to change notification settings - Fork 155
137 lines (126 loc) · 4.57 KB
/
build_ctest.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
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
# Extra tooled builds (outside of matrix)
- name: macOS_asan
target: TestRunner
os: macos-latest
config_preset: "xcode"
build_preset: "xcode-ReleaseAsan"
cmake_host_system_name: "Darwin"
- name: macOS_asan
target: Benchmarks
os: macos-latest
config_preset: "xcode"
build_preset: "xcode-ReleaseAsan"
cmake_host_system_name: "Darwin"
- name: macOS_analyse
target: TestRunner
os: macos-latest
analyse: true
- name: macOS_analyse
target: Benchmarks
os: macos-latest
analyse: 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
- 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