Skip to content

Commit

Permalink
Update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
uweseimet committed Dec 5, 2023
1 parent 5c4364f commit baf25ea
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/analyze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@ name: Run SonarCloud analysis

on:
workflow_dispatch:

inputs:
branch:
required: true
type: choice
description: Branch to analyze
options:
- develop
- main
jobs:
code_analysis:
runs-on: ubuntu-latest

defaults:
run:
working-directory: cpp

env:
PACKAGES: protobuf-compiler libspdlog-dev libpcap-dev libgmock-dev
BUILD_WRAPPER_OUT_DIR: "$HOME/.build_wrapper_out"
BUILD_WRAPPER_OUT_DIR: ".build_wrapper_out"
SONAR_SERVER_URL: "https://sonarcloud.io"
SONAR_PROJECT_KEY: "uweseimet_scsi2pi"
SONAR_ORGANIZATION: ${{ secrets.SONAR_ORGANIZATION }}
Expand Down Expand Up @@ -41,13 +44,15 @@ jobs:

- name: Run build-wrapper
run: |
cd cpp &&
build-wrapper-linux-x86-64 --out-dir $BUILD_WRAPPER_OUT_DIR make -j $(nproc) coverage DEBUG=1
- name: Generate coverage data
run: gcovr --sonarqube > coverage.xml

- name: Run sonar-scanner
run: |
cd cpp &&
sonar-scanner \
--define sonar.host.url=$SONAR_SERVER_URL \
--define sonar.projectKey=$SONAR_PROJECT_KEY \
Expand Down

0 comments on commit baf25ea

Please sign in to comment.