Try tests in build action

This commit is contained in:
2023-02-24 11:32:10 +01:00
parent 32a6fd9ba0
commit 848ee7ba24
4 changed files with 21 additions and 7 deletions

View File

@@ -3,6 +3,7 @@ on:
push:
branches:
- main
- test
pull_request:
types: [opened, synchronize, reopened]
jobs:
@@ -15,16 +16,18 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Install sonar-scanner and build-wrapper
uses: SonarSource/sonarcloud-github-c-cpp@v1
- name: Run build-wrapper
- name: Tests & build-wrapper
run: |
mkdir build
cmake -S . -B build
cmake -S . -B build -Wno-dev
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build build/ --config Release
cd build
ctest -C Release --output-on-failure
- name: Install sonar-scanner and build-wrapper
uses: SonarSource/sonarcloud-github-c-cpp@v1
- name: Run sonar-scanner
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # Put the name of your token here
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
sonar-scanner --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}"