diff --git a/.github/workflows/analyze.yml b/.github/workflows/analyze.yml index 881f16c0..6868f30d 100644 --- a/.github/workflows/analyze.yml +++ b/.github/workflows/analyze.yml @@ -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 }} @@ -41,6 +44,7 @@ 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 @@ -48,6 +52,7 @@ jobs: - name: Run sonar-scanner run: | + cd cpp && sonar-scanner \ --define sonar.host.url=$SONAR_SERVER_URL \ --define sonar.projectKey=$SONAR_PROJECT_KEY \