Skip to content

testing Update prj.conf #17

testing Update prj.conf

testing Update prj.conf #17

Workflow file for this run

name: SonarCloud
on:
push:
branches:
- main
paths:
- '.github/workflows/sonarcloud.yml'
- 'applications/nrf5340_audio/**/*'
- 'applications/nrf5340_audio/**/*'
pull_request_target:
types: [opened, synchronize, reopened]
paths:
- 'applications/nrf5340_audio/**/*'
- 'applications/nrf5340_audio/**/*'
jobs:
build:
name: Build and analyze
runs-on: ubuntu-22.04
container: ghcr.io/nrfconnect/sdk-nrf-toolchain:v2.9.0
defaults:
run:
# Bash shell is needed to set toolchain related environment variables in docker container
# It is a workaround for GitHub Actions limitation https://github.com/actions/runner/issues/1964
shell: bash
env:
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
CMAKE_PREFIX_PATH: /opt/toolchains
steps:
- uses: nrfconnect/action-checkout-west-update@main
if: github.event_name == 'pull_request_target'
with:
git-ref: ${{ github.event.pull_request.head.sha }}
git-fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
path: ncs/nrf
- uses: nrfconnect/action-checkout-west-update@main
if: github.event_name != 'pull_request_target'
with:
git-fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
path: ncs/nrf
- name: Install dependencies
run: |
apt-get update
apt-get install -y curl unzip ruby gcc-multilib make
- name: Install build-wrapper
uses: SonarSource/sonarqube-scan-action/[email protected]
- name: Build and test
working-directory: ncs/nrf
run: |
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} ../zephyr/scripts/twister \
--ninja --integration \
--quarantine-list scripts/quarantine.yaml --quarantine-list scripts/quarantine_integration.yaml \
-T applications/nrf5340_audio
- name: SonarQube Scan main
uses: SonarSource/[email protected]
if: github.event_name != 'pull_request_target'
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
# Consult https://docs.sonarsource.com/sonarqube-server/latest/analyzing-source-code/scanners/sonarscanner/ for more information and options
args: >
--define sonar.cfamily.compile-commands="ncs/nrf/${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json"
--define sonar.sources=ncs/nrf/applications/nrf5340_audio
--define sonar.inclusions=**/*.c,**/*.h
--define sonar.organization=nrfconnect
--define sonar.projectKey=nrfconnect_sdk-nrf-testing
--define sonar.sourceEncoding=US-ASCII
- name: SonarQube Scan PR
uses: SonarSource/[email protected]
if: github.event_name == 'pull_request_target'
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
PR_BRANCH: ${{ github.event.pull_request.head.ref }}
BASE_REF: ${{ github.event.pull_request.base.ref }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
with:
# Consult https://docs.sonarsource.com/sonarqube-server/latest/analyzing-source-code/scanners/sonarscanner/ for more information and options
args: >
--define sonar.cfamily.compile-commands="ncs/nrf/${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json"
--define sonar.sources=ncs/nrf/applications/nrf5340_audio
--define sonar.inclusions=**/*.c,**/*.h
--define sonar.organization=nrfconnect
--define sonar.projectKey=nrfconnect_sdk-nrf-testing
--define sonar.sourceEncoding=US-ASCII
--define sonar.scm.revision=${{ env.HEAD_SHA }}
--define sonar.pullrequest.key=${{ env.PR_NUMBER }}
--define sonar.pullrequest.branch=${{ env.PR_BRANCH }}
--define sonar.pullrequest.base=${{ env.BASE_REF }}