Skip to content

Commit

Permalink
Update SonarCloud job to use github action to install sonar-scanner and
Browse files Browse the repository at this point in the history
build-wrapper.

Signed-off-by: Christina Tempelaar-Lietz <[email protected]>
  • Loading branch information
xlietz committed May 21, 2023
1 parent a00bac5 commit 1f311ef
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 515 deletions.
24 changes: 18 additions & 6 deletions .github/workflows/analysis_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@
name: Analysis

on:
schedule:
# schedule:
# Weekly Sunday build
- cron: "0 0 * * 0"
workflow_dispatch:
# - cron: "0 0 * * 0"
# workflow_dispatch:
#
pull-request:
branches:
- main

permissions:
contents: read
Expand All @@ -33,6 +37,7 @@ jobs:
env:
CXX: g++
CC: gcc
BUILD_WRAPPER_OUT_DIR: bw-output
steps:
# TODO: Remove this workaround following resolution of:
# https://github.com/AcademySoftwareFoundation/aswf-docker/issues/43
Expand All @@ -41,7 +46,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 50
# Disabling shallow clone is recommended for improving the
# relevancy of reporting
fetch-depth: 0
- name: Install sonar-scanner and build-wrapper
uses: sonarsource/sonarcloud-github-c-cpp@v1
- name: Create build directories
run: |
mkdir _install
Expand All @@ -66,7 +75,8 @@ jobs:
- name: Build OpenEXR with build-wrapper
shell: bash
run: |
build-wrapper-linux-x86-64 --out-dir bw_output \
build-wrapper-linux-x86-64 \
--out-dir "${{ env.BUILD_WRAPPER_OUT_DIR }}" \
cmake --build . \
--target install \
--config Release
Expand All @@ -86,7 +96,9 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: sonar-scanner -X -Dsonar.login=$SONAR_TOKEN
run: sonar-scanner -X -Dsonar.login=$SONAR_TOKEN \
--define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}"


# ------------------------------------------------------------------------------
# Valgrind memcheck test
Expand Down
Loading

0 comments on commit 1f311ef

Please sign in to comment.