Skip to content

Tests and Benchmarks #7

Tests and Benchmarks

Tests and Benchmarks #7

Workflow file for this run

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
nparallel: 4
# - name: MacOS
# os: macos-14
# 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
- 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" -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