use if, instead of min #3736
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow | |
name: build-checks | |
on: | |
push: | |
pull_request: | |
permissions: | |
contents: read # to fetch code (actions/checkout) | |
jobs: | |
build-checks: | |
permissions: | |
contents: read # to fetch code (actions/checkout) | |
checks: write # to create new checks (coverallsapp/github-action) | |
strategy: | |
matrix: | |
include: | |
- name: clazy | |
- name: clang-tidy | |
- name: coverage | |
runs-on: ubuntu-22.04 | |
name: ${{ matrix.name }} | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4.2.1 | |
- name: Install build dependencies | |
run: tools/debian_buildenv.sh setup | |
- name: Create build directory | |
run: mkdir build | |
- name: Configure (clazy) | |
if: matrix.name == 'clazy' | |
# Disable optimizations as workaround for Clang 9 bug: https://bugs.llvm.org/show_bug.cgi?id=45034 | |
run: | | |
cmake \ | |
-DCMAKE_BUILD_TYPE=Debug \ | |
-DWARNINGS_FATAL=ON \ | |
-DQT6=ON \ | |
-DOPTIMIZE=off \ | |
-DBATTERY=ON \ | |
-DBROADCAST=ON \ | |
-DBULK=ON \ | |
-DHID=ON \ | |
-DLILV=ON \ | |
-DOPUS=ON \ | |
-DQTKEYCHAIN=ON \ | |
-DVINYLCONTROL=ON \ | |
-DFFMPEG=ON \ | |
-DKEYFINDER=ON \ | |
-DLOCALECOMPARE=ON \ | |
-DMAD=ON \ | |
-DMODPLUG=ON \ | |
-DWAVPACK=ON \ | |
.. | |
working-directory: build | |
env: | |
LD: clang++ | |
CC: clang | |
CXX: clazy | |
- name: Configure (clang-tidy) | |
if: matrix.name == 'clang-tidy' | |
run: | | |
cmake \ | |
-DCMAKE_BUILD_TYPE=Debug \ | |
-DCLANG_TIDY=clang-tidy \ | |
-DWARNINGS_FATAL=ON \ | |
-DQT6=ON \ | |
-DBATTERY=ON \ | |
-DBROADCAST=ON \ | |
-DBULK=ON \ | |
-DHID=ON \ | |
-DLILV=ON \ | |
-DOPUS=ON \ | |
-DQTKEYCHAIN=ON \ | |
-DVINYLCONTROL=ON \ | |
-DFFMPEG=ON \ | |
-DKEYFINDER=ON \ | |
-DLOCALECOMPARE=ON \ | |
-DMAD=ON \ | |
-DMODPLUG=ON \ | |
-DWAVPACK=ON \ | |
.. | |
working-directory: build | |
env: | |
LD: clang++ | |
CC: clang | |
CXX: clang++ | |
- name: Configure (coverage) | |
if: matrix.name == 'coverage' | |
run: | | |
cmake \ | |
-DCMAKE_BUILD_TYPE=Debug \ | |
-DOPTIMIZE=off \ | |
-DQT6=ON \ | |
-DQML=ON \ | |
-DCOVERAGE=ON \ | |
-DWARNINGS_FATAL=OFF \ | |
-DDEBUG_ASSERTIONS_FATAL=OFF \ | |
-DBATTERY=ON \ | |
-DBROADCAST=ON \ | |
-DBULK=ON \ | |
-DHID=ON \ | |
-DLILV=ON \ | |
-DOPUS=ON \ | |
-DQTKEYCHAIN=ON \ | |
-DVINYLCONTROL=ON \ | |
-DFFMPEG=ON \ | |
-DKEYFINDER=ON \ | |
-DLOCALECOMPARE=ON \ | |
-DMAD=ON \ | |
-DMODPLUG=ON \ | |
-DWAVPACK=ON \ | |
.. | |
working-directory: build | |
- name: Set up problem matcher | |
uses: ammaraskar/gcc-problem-matcher@0.3.0 | |
# Work around https://github.com/actions/runner-images/issues/8659 | |
- name: "Remove GCC 13 from runner image (workaround)" | |
shell: bash | |
run: | | |
sudo rm -f /etc/apt/sources.list.d/ubuntu-toolchain-r-ubuntu-test-jammy.list | |
sudo apt-get update | |
sudo apt-get install -y --allow-downgrades libc6=2.35* libc6-dev=2.35* libstdc++6=12.3.0-1ubuntu1~22.04 libgcc-s1=12.3.0-1ubuntu1~22.04 | |
- name: Build | |
# Do not abort on errors and build/check the whole project | |
run: cmake --build . -j $(nproc) -- --keep-going | |
working-directory: build | |
env: | |
CLAZY_CHECKS: level2,container-inside-loop,heap-allocated-small-trivial-type,isempty-vs-count,qhash-with-char-pointer-key,qproperty-type-mismatch,tr-non-literal,no-rule-of-two-soft,no-non-pod-global-static,no-qproperty-without-notify,no-qstring-allocations,no-function-args-by-value,no-copyable-polymorphic,no-ctor-missing-parent-argument,no-missing-qobject-macro,no-rule-of-three,no-returning-void-expression | |
CLAZY_IGNORE_DIRS: lib/.* | |
- name: "Test" | |
if: matrix.name == 'coverage' | |
run: ctest --timeout 45 | |
working-directory: build | |
env: | |
# Render analyzer waveform tests to an offscreen buffer | |
QT_QPA_PLATFORM: ${{ matrix.qt_qpa_platform }} | |
GTEST_COLOR: 1 | |
# Only use single thread to prevent *.gcna files from overwriting each other | |
CTEST_PARALLEL_LEVEL: 1 | |
CTEST_OUTPUT_ON_FAILURE: 1 | |
- name: "Generate Coverage Report" | |
if: matrix.name == 'coverage' | |
run: >- | |
lcov | |
--capture | |
--directory . | |
--base-directory .. | |
--include "${PWD%/*}/src/*" | |
--exclude "${PWD%/*}/src/test/*" | |
--exclude "${PWD%/*}/build/*" | |
--exclude "${PWD%/*}/lib/*" | |
--output-file lcov.info | |
working-directory: build | |
- name: "Upload Coverage Report to coveralls.io" | |
if: matrix.name == 'coverage' | |
continue-on-error: true | |
uses: coverallsapp/github-action@v2.3.4 | |
with: | |
flag-name: ubuntu-22.04 | |
path-to-lcov: build/lcov.info | |
github-token: ${{ secrets.GITHUB_TOKEN }} |