Skip to content

Commit

Permalink
Cache sonar
Browse files Browse the repository at this point in the history
  • Loading branch information
TrentHouliston committed Sep 24, 2023
1 parent 2320116 commit 9521d2d
Showing 1 changed file with 26 additions and 3 deletions.
29 changes: 26 additions & 3 deletions .github/workflows/sonarcloud.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,34 @@ jobs:
- name: Install sonar-scanner and build-wrapper
uses: SonarSource/sonarcloud-github-c-cpp@v2

- name: Run build-wrapper
- name: Install CMake
uses: lukka/get-cmake@latest
with:
cmakeVersion: 3.27.1
ninjaVersion: 1.11.1

- name: Setup CCache
uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}
max-size: 100M

- name: Configure CMake
run: |
cmake -E make_directory build
cmake -S . -B build -DCMAKE_CXX_FLAGS="--coverage" -DBUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Debug -DCI_BUILD=ON
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build build/ --config Debug
cmake -S . -B build \
-GNinja \
-DCMAKE_CXX_FLAGS="--coverage" \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DBUILD_TESTS=ON \
-DCMAKE_BUILD_TYPE=Debug \
-DCI_BUILD=ON \
-DENABLE_CLANG_TIDY=OFF
- name: Build with Sonar Wrapper
timeout-minutes: 30
run: build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build build/ --config Debug

- name: Run tests to generate coverage statistics
timeout-minutes: 10
Expand Down

0 comments on commit 9521d2d

Please sign in to comment.