Skip to content

doc: Add back new theme and remove old doc workflow #1146

doc: Add back new theme and remove old doc workflow

doc: Add back new theme and remove old doc workflow #1146

Workflow file for this run

name: SonarCloud
on:
push:
branches:
- main
paths-ignore:
- ".github/workflows/docs-build-and-publish.yml"
- "docs/**"
pull_request:
paths:
- '**/*.c'
- '**/*.h'
- west.yml
- '**/CMakelists.txt'
- '**/Kconfig*'
- '**/prj.conf'
jobs:
build:
name: Build and analyze
runs-on: self-hosted
container: ghcr.io/zephyrproject-rtos/ci:v0.28.7
env:
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
CMAKE_PREFIX_PATH: /opt/toolchains
steps:
- uses: actions/checkout@v4
if: github.event_name == 'pull_request'
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
path: thingy91x-oob
- uses: actions/checkout@v4
if: github.event_name != 'pull_request'
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
path: thingy91x-oob
- name: Initialize
working-directory: thingy91x-oob
run: |
if [ ! -d "../.west" ]; then
west init -l .
else
echo ".west folder already exists, skipping west init."
fi
west update -o=--depth=1 -n
west blobs fetch hal_nordic
- name: Install dependencies
run: |
# The Matter IDL is part of requirements-build.txt, but it's not available
# in pypi so we need to install it from the source code
MATTER_IDL_PATH=modules/lib/matter/scripts/py_matter_idl
if [ -d $MATTER_IDL_PATH ]; then
pip install -e $MATTER_IDL_PATH
fi
pip install -r nrf/scripts/requirements-fixed.txt
apt-get update
apt install -y curl ruby-full
- name: Install Build Wrapper
uses: SonarSource/sonarqube-scan-action/install-build-wrapper@v6.0.0
- name: Build and test
working-directory: thingy91x-oob
run: |
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} \
west twister -T tests/ \
--enable-coverage \
--coverage-platform=native_sim \
-v \
--inline-logs \
--integration
- name: Extract coverage into sonarqube xml format
working-directory: thingy91x-oob
run: |
gcovr twister-out -v --merge-mode-functions=separate --exclude='twister-out|drivers' --sonarqube coverage.xml
- name: SonarQube Scan on main
if: github.event_name != 'pull_request'
uses: SonarSource/sonarqube-scan-action@v6.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: |
--define sonar.cfamily.build-wrapper-output=thingy91x-oob/${{ env.BUILD_WRAPPER_OUT_DIR }}
--define sonar.projectKey=hello-nrfcloud_firmware
--define sonar.organization=hello-nrfcloud-com-firmware
--define sonar.host.url=https://sonarcloud.io
--define sonar.coverageReportPaths=coverage.xml
--define sonar.inclusions=**/*.c,**/*.h
--define sonar.exclusions=tests/,drivers/sensor/*_dummy/
projectBaseDir: thingy91x-oob
- name: SonarQube Scan on PR
if: github.event_name == 'pull_request'
uses: SonarSource/sonarqube-scan-action@v6.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: |
--define sonar.cfamily.build-wrapper-output=thingy91x-oob/${{ env.BUILD_WRAPPER_OUT_DIR }}
--define sonar.projectKey=hello-nrfcloud_firmware
--define sonar.organization=hello-nrfcloud-com-firmware
--define sonar.host.url=https://sonarcloud.io
--define sonar.coverageReportPaths=coverage.xml
--define sonar.inclusions=**/*.c,**/*.h
--define sonar.exclusions=tests/,drivers/sensor/*_dummy/
--define sonar.scm.revision=${{ github.event.pull_request.head.sha }}
--define sonar.pullrequest.key=${{ github.event.pull_request.number }}
--define sonar.pullrequest.branch=${{ github.event.pull_request.head.ref }}
--define sonar.pullrequest.base=${{ github.event.pull_request.base.ref }}
projectBaseDir: thingy91x-oob