-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (70 loc) · 2.54 KB
/
coverage.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
name: Coverage
on:
pull_request:
branches:
- main
- develop
push:
branches:
- ci
workflow_dispatch:
jobs:
build_and_test:
name: Test library with coverage
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false # show all errors for each platform (vs. cancel jobs on error)
matrix:
include:
- name: Linux
os: ubuntu-22.04
cmake_args: "-DCMAKE_LINKER_TYPE=MOLD -DCMAKE_C_COMPILER=clang-15 -DCMAKE_CXX_COMPILER=clang++-15"
nparallel: 4
- name: MacOS
os: macos-14
cmake_args: "-D\"CMAKE_OSX_ARCHITECTURES=arm64;x86_64\""
nparallel: 4
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 libjack-jackd2-dev
sudo apt-add-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-15 main"
sudo apt install clang-15 -y
- name: Install lcov (Linux)
if: runner.os == 'Linux'
run: sudo apt install lcov
- name: Install lcov (Mac)
if: runner.os == 'MacOS'
run: |
export HOMEBREW_NO_AUTO_UPDATE=1
brew install lcov
- name: Install Ninja
uses: seanmiddleditch/gha-setup-ninja@master
- name: Get latest CMake
uses: lukka/get-cmake@latest
- uses: rui314/setup-mold@v1
if: runner.os == 'Linux'
- name: Checkout code
uses: actions/checkout@v2
- name: Cmake Configure
run: cmake -Bbuild -G"Ninja Multi-Config" ${{ matrix.cmake_args }} -DCHOWDSP_FFT_TESTING=ON -DCHOWDSP_FFT_COVERAGE=ON
- name: Build Test
run: cmake --build build --config Debug --parallel --target test_chowdsp_fft_cpp
- name: Run Test
run: ./build/test/Debug/test_chowdsp_fft_cpp
- name: Collect Coverage Data
run: |
lcov --version
lcov --directory . --capture --output-file coverage.info
lcov --remove coverage.info '/usr/*' "${HOME}"'/.cache/*' '/Applications/Xcode*' '*build*' '*test*' --output-file coverage.info
- name: Report Coverage Data
run: lcov --list coverage.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.info
verbose: true