-
-
Notifications
You must be signed in to change notification settings - Fork 15
103 lines (82 loc) · 3.55 KB
/
tests.yml
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
name: Tests
on:
workflow_dispatch:
push:
pull_request:
env:
BUILD_TYPE: Release
BUILD_DIR: Builds
HOMEBREW_NO_INSTALL_CLEANUP: 1
SCCACHE_GHA_ENABLED: "true"
concurrency:
group: ${{ github.workflow }}.${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
permissions:
contents: read
jobs:
BuildAndTest:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
name: Tests
runs-on: ${{ matrix.os }}
timeout-minutes: 20 # macos-11 in particular needs more than 15 min
strategy:
fail-fast: false # show errors for each platform vs. cancel build
matrix:
os: [ macos-11, macos-12, macos-13, macos-14, windows-2022, windows-2019, ubuntu-latest ]
juce: [ JUCE7, JUCE8 ]
steps:
# Setup MSVC toolchain and developer command prompt (Windows)
- uses: ilammy/msvc-dev-cmd@v1
with:
sdk: 10.0.22621.0
# This block can be removed once 15.1 is default (JUCE requires it when building on macOS 14)
- name: Use latest Xcode on system (macOS)
if: ${{ runner.os == 'macOS' }}
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Install Ninja (Windows)
if: runner.os == 'Windows'
run: choco install ninja
- name: Install macOS Deps
if: ${{ runner.os == 'macOS' }}
run: brew install ninja osxutils
- name: Install Linux Deps
if: runner.os == 'Linux'
run: |
sudo apt-get update && sudo apt install libasound2-dev libx11-dev libxinerama-dev libxext-dev libfreetype6-dev libwebkit2gtk-4.0-dev libglu1-mesa-dev ninja-build
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.4
- name: Configure
if: runner.os == 'Windows'
# D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR is a temporary workaround for a Visual Studio+GA snafu
# check if resolved here: https://github.com/sudara/pamplejuce/issues/103
run: |
if [ "${{ matrix.juce }}" == "JUCE7" ]; then
cmake -B ${{ env.BUILD_DIR }} -G Ninja -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE}} -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache . -DCMAKE_SYSTEM_VERSION=10.0.22621.0 -DCMAKE_CXX_FLAGS=" /D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR -DJUCE7=ON"
else
cmake -B ${{ env.BUILD_DIR }} -G Ninja -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE}} -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache . -DCMAKE_SYSTEM_VERSION=10.0.22621.0 -DCMAKE_CXX_FLAGS=" /D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR"
fi
- name: Configure
if: runner.os != 'Windows'
run: |
if [ "${{ matrix.juce }}" == "JUCE7" ]; then
cmake -B ${{ env.BUILD_DIR }} -G Ninja -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE}} -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache . -DJUCE7=ON
else
cmake -B ${{ env.BUILD_DIR }} -G Ninja -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE}} -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache .
fi
- name: Build
run: cmake --build ${{ env.BUILD_DIR }} --config ${{ env.BUILD_TYPE }} --parallel 4
- name: Tests
working-directory: ${{ env.BUILD_DIR }}
run: ./Tests
- name: Benchmarks
working-directory: ${{ env.BUILD_DIR }}
run: ./Benchmarks