-
Notifications
You must be signed in to change notification settings - Fork 24
153 lines (136 loc) · 5.6 KB
/
run-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
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
name: Test
on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:
env:
WORK_DIR: ${{github.workspace}}/JUCE_modules/chowdsp_utils
jobs:
build_and_test:
name: "Run ${{ matrix.name }} ${{ matrix.tests }} on ${{ matrix.os }}"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false # show all errors for each platform (vs. cancel jobs on error)
matrix:
tests: [
"chowdsp_core_test chowdsp_data_structures_test chowdsp_json_test chowdsp_serialization_test chowdsp_logging_test chowdsp_units_test chowdsp_buffers_test chowdsp_dsp_juce_test", # common_tests_lib + dsp_juce_tests_lib
"chowdsp_dsp_data_structures_test chowdsp_dsp_utils_test chowdsp_filters_test chowdsp_math_test chowdsp_modal_dsp_test chowdsp_simd_test chowdsp_sources_test chowdsp_waveshapers_test chowdsp_compressor_test", # dsp_tests_lib
"chowdsp_parameters_test chowdsp_plugin_state_test chowdsp_plugin_base_test chowdsp_plugin_utils_test chowdsp_presets_v2_test chowdsp_version_test chowdsp_fuzzy_search_test", # plugin_tests_lib
"chowdsp_gui_test chowdsp_visualizers_test", # gui_tests_lib
]
name: [
"Test",
"Coverage",
]
os: [ubuntu-22.04, windows-2022, macos-14]
include:
- name: "Test"
os: ubuntu-22.04
cmake_args: "-DCMAKE_BUILD_TYPE=Release"
build_type: "Release"
- name: "Test"
os: windows-2022
build_type: "Debug"
- name: "Coverage"
os: ubuntu-22.04
cmake_args: "-DCODE_COVERAGE=ON -DCMAKE_BUILD_TYPE=Debug"
run_coverage: true
build_type: "Debug"
- name: "Test"
os: macos-14
cmake_args: "-DCMAKE_BUILD_TYPE=Debug"
build_type: "Debug"
- name: "Live GUI Test"
os: ubuntu-22.04
tests: "live_gui_test"
cmake_args: "-DCODE_COVERAGE=ON -DCHOWDSP_BUILD_LIVE_GUI_TEST=ON -DCMAKE_BUILD_TYPE=Debug"
live_gui: true
run_coverage: true
build_type: "Debug"
exclude:
# so we don't break GitHub Actions concurrency limit
- name: "Coverage"
os: macos-14
- name: "Coverage"
os: windows-2022
steps:
- name: Install Linux Deps
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt install libasound2-dev libcurl4-openssl-dev libx11-dev libxinerama-dev libxext-dev libfreetype6-dev libwebkit2gtk-4.0-dev libglu1-mesa-dev libsamplerate-dev
- name: Install lcov (Linux)
if: matrix.run_coverage && runner.os == 'Linux'
run: sudo apt install lcov
- name: Install lcov (Mac)
if: matrix.run_coverage && runner.os == 'MacOS'
run: |
export HOMEBREW_NO_AUTO_UPDATE=1
brew install lcov
- name: Get latest CMake
uses: lukka/get-cmake@latest
- name: Checkout code
uses: actions/checkout@v2
with:
path: ${{env.WORK_DIR}}
- name: Set up environment
working-directory: ${{github.workspace}}
run: |
git clone --depth 1 --branch 7.0.6 https://github.com/juce-framework/JUCE.git
cd JUCE_modules
git clone --single-branch --branch main --recursive https://github.com/free-audio/clap-juce-extensions.git
- name: Configure
working-directory: ${{env.WORK_DIR}}
env:
CMAKE_ARGS: ${{ matrix.cmake_args }}
shell: bash
run: cmake -Bbuild -DCHOWDSP_ENABLE_TESTING=ON $CMAKE_ARGS
- name: Build
working-directory: ${{env.WORK_DIR}}/build
shell: bash
env:
TEST_TARGETS: ${{ matrix.tests }}
BUILD_TYPE: ${{ matrix.build_type }}
run: cmake --build . --config $BUILD_TYPE --parallel 4 --target $TEST_TARGETS
- name: "Run Tests: ${{ matrix.tests }}"
if: (! matrix.live_gui)
working-directory: ${{env.WORK_DIR}}
shell: bash
env:
TEST_TARGETS: ${{ matrix.tests }}
BUILD_TYPE: ${{ matrix.build_type }}
run: |
ctest --test-dir build -C $BUILD_TYPE -R ${TEST_TARGETS// /|} --show-only
ctest --test-dir build -C $BUILD_TYPE -R ${TEST_TARGETS// /|} -j 4 --no-tests=error --output-on-failure
- name: "Run Live GUI Test"
if: matrix.live_gui
uses: GabrielBB/xvfb-action@v1
with:
run: ./live_gui_test
working-directory: ${{env.WORK_DIR}}/build/test-binary
- name: Collect Coverage Data
if: matrix.run_coverage
working-directory: ${{env.WORK_DIR}}
shell: bash
run: |
lcov --directory . --capture --output-file coverage.info
lcov --remove coverage.info '/usr/*' "${HOME}"'/.cache/*' '/Applications/Xcode*' '*chowdsp_utils/build/*' '*JUCE/modules*' '*foleys_*' '*chowdsp_utils/tests*' '*third_party*' '*chowdsp_foleys*' '*chowdsp_core/JUCEHelpers*' --output-file coverage.info
- name: Report Coverage Data
if: matrix.run_coverage
working-directory: ${{env.WORK_DIR}}
shell: bash
run: lcov --list coverage.info
- name: Upload coverage to Codecov
if: matrix.run_coverage
uses: codecov/codecov-action@v4
with:
working-directory: ${{env.WORK_DIR}}
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
files: ${{env.WORK_DIR}}/coverage.info
codecov_yml_path: ${{env.WORK_DIR}}/codecov.yml
verbose: true