From a4971b5f68a811747841ab11876a6d3bd4a34ab9 Mon Sep 17 00:00:00 2001 From: badaix Date: Thu, 6 Jun 2024 21:35:12 +0200 Subject: [PATCH] Add unit-tests to CI --- .github/workflows/ci.yml | 52 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1111b272..d433bf42 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,6 +52,58 @@ jobs: run: cmake --build build --target ${{ matrix.tool }} + unit-test: + + strategy: + fail-fast: false + matrix: + sanitizer: + - asan + - tsan + include: + - sanitizer: asan + param: "ASAN=ON" + - compiler: tsan + param: "TSAN=ON" + + runs-on: ubuntu-22.04 + + steps: + - uses: actions/checkout@v4 + - name: print environment + run: env + - name: dependencies + run: | + sudo apt-get update && \ + sudo apt-get install -yq libasound2-dev libsoxr-dev libvorbisidec-dev libvorbis-dev libflac-dev \ + libopus-dev alsa-utils libpulse-dev libavahi-client-dev libssl-dev \ + avahi-daemon debhelper ccache expat cppcheck + - name: cache boost + id: cache-boost + uses: actions/cache@v4 + with: + path: boost_${{ env.BOOST_VERSION }} + key: boost-${{ env.BOOST_VERSION }} + enableCrossOsArchive: true + - name: get boost + if: steps.cache-boost.outputs.cache-hit != 'true' + run: | + wget https://boostorg.jfrog.io/artifactory/main/release/${BOOST_VERSION//_/.}/source/boost_${BOOST_VERSION}.tar.bz2 + tar xjf boost_${BOOST_VERSION}.tar.bz2 + - name: configure + run: | + cmake -S . -B build \ + -DWERROR=ON \ + -DBUILD_TESTS=ON \ + -D${{ matrix.param }} \ + -DBOOST_ROOT=boost_${BOOST_VERSION} \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_EXPORT_COMPILE_COMMANDS=TRUE \ + -DCMAKE_CXX_FLAGS="-DCMAKE_CXX_FLAGS=-DJSON_HAS_CPP_14" + - name: analysis + run: cmake --build build --verbose + + linux: strategy: