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 4, 2023
1 parent d2460f0 commit f5ccc13
Showing 1 changed file with 18 additions and 6 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

jobs:

Expand All @@ -30,6 +34,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 @@ -38,7 +43,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 @@ -63,7 +72,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 @@ -83,7 +93,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

0 comments on commit f5ccc13

Please sign in to comment.