Skip to content

Commit

Permalink
Add static-analysis job
Browse files Browse the repository at this point in the history
  • Loading branch information
badaix committed Dec 30, 2023
1 parent 761878d commit 8ea68ac
Showing 1 changed file with 51 additions and 5 deletions.
56 changes: 51 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,57 @@ env:
BOOST_VERSION: 1_84_0

jobs:
static-analysis:

strategy:
fail-fast: false
matrix:
tool:
- cppcheck

runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3
- 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 avahi-daemon debhelper ccache expat cppcheck
- name: cache boost
id: cache-boost
uses: actions/cache@v3
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: cache ccache
id: cache-ccache
uses: actions/cache@v3
with:
# TODO: use environment variable $HOME/.ccache
path: /home/runner/.ccache
key: ${{ runner.os }}-${{ matrix.compiler }}-ccache-${{ github.sha }}
restore-keys: ${{ runner.os }}-${{ matrix.compiler }}-ccache-
#- name: ccache dump config
# run: ccache -p
- name: configure
run: |
cmake -S . -B build \
-DWERROR=ON -DBUILD_TESTS=ON \
-DBOOST_ROOT=boost_${BOOST_VERSION} \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_EXPORT_COMPILE_COMMANDS=TRUE \
-DCMAKE_CXX_FLAGS="-DCMAKE_CXX_FLAGS=-DJSON_HAS_CPP_14"
- name: analysis
run: cmake --build build --target ${{ matrix.tool }}


linux:

strategy:
Expand All @@ -28,7 +79,6 @@ jobs:
- gcc-11
- gcc-12
- gcc-13
- cppcheck
include:
- compiler: clang-10
cc: clang-10
Expand Down Expand Up @@ -120,14 +170,10 @@ jobs:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
- name: build
if: matrix.compiler != 'cppcheck'
env:
# TODO: use environment variable $HOME/.ccache
CCACHE_DIR: /home/runner/.ccache
run: cmake --build build --parallel 3 --verbose
- name: cppcheck
if: matrix.compiler == 'cppcheck'
run: cmake --build build --target cppcheck


macos:
Expand Down

0 comments on commit 8ea68ac

Please sign in to comment.