1717jobs :
1818 build :
1919 name : Build and analyze
20- runs-on : ubuntu-latest
20+ runs-on : self-hosted
2121 container : ghcr.io/zephyrproject-rtos/ci:v0.27.4
2222 env :
2323 BUILD_WRAPPER_OUT_DIR : build_wrapper_output_directory # Directory where build-wrapper output will be placed
@@ -39,63 +39,79 @@ jobs:
3939 - name : Initialize
4040 working-directory : thingy91x-oob
4141 run : |
42+ if [ ! -d "../.west" ]; then
4243 west init -l .
43- west config manifest.group-filter +bsec
44- west config build.sysbuild True
45- west update -o=--depth=1 -n
46- west blobs fetch hal_nordic
44+ else
45+ echo ".west folder already exists, skipping west init."
46+ fi
47+ west update -o=--depth=1 -n
48+ west blobs fetch hal_nordic
4749
4850 - name : Install dependencies
4951 run : |
50- pip install -r nrf/scripts/requirements-build.txt
51- apt-get update
52- apt install -y curl ruby-full
52+ # The Matter IDL is part of requirements-build.txt, but it's not available
53+ # in pypi so we need to install it from the source code
54+ MATTER_IDL_PATH=modules/lib/matter/scripts/py_matter_idl
55+ if [ -d $MATTER_IDL_PATH ]; then
56+ pip install -e $MATTER_IDL_PATH
57+ fi
58+ pip install -r nrf/scripts/requirements-fixed.txt
59+ apt-get update
60+ apt install -y curl ruby-full
5361
54- - name : Install sonar-scanner and build-wrapper
55- uses : SonarSource/sonarcloud-github-c-cpp@v3
62+ - name : Install Build Wrapper
63+ uses : SonarSource/sonarqube-scan-action/install-build-wrapper@v6.0.0
5664
5765 - name : Build and test
5866 working-directory : thingy91x-oob
5967 run : |
60- build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} west twister -T . -C --coverage-platform=native_sim -v --inline-logs --integration
68+ build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} \
69+ west twister -T tests/ \
70+ --enable-coverage \
71+ --coverage-platform=native_sim \
72+ -v \
73+ --inline-logs \
74+ --integration
6175
6276 - name : Extract coverage into sonarqube xml format
6377 working-directory : thingy91x-oob
6478 run : |
6579 gcovr twister-out -v --merge-mode-functions=separate --exclude='twister-out|drivers' --sonarqube coverage.xml
6680
67- - name : Run sonar-scanner on main
68- working-directory : thingy91x-oob
81+ - name : SonarQube Scan on main
6982 if : github.event_name != 'pull_request'
83+ uses : SonarSource/sonarqube-scan-action@v6.0.0
7084 env :
7185 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
7286 SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
73- run : |
74- sonar-scanner \
75- --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}" \
76- --define project.settings=sonar-project.properties \
77- --define sonar.coverageReportPaths=coverage.xml \
78- --define sonar.inclusions=**/*.c,**/*.h \
87+ with :
88+ args : |
89+ --define sonar.cfamily.build-wrapper-output=thingy91x-oob/${{ env.BUILD_WRAPPER_OUT_DIR }}
90+ --define sonar.projectKey=hello-nrfcloud_firmware
91+ --define sonar.organization=hello-nrfcloud-com-firmware
92+ --define sonar.host.url=https://sonarcloud.io
93+ --define sonar.coverageReportPaths=coverage.xml
94+ --define sonar.inclusions=**/*.c,**/*.h
7995 --define sonar.exclusions=tests/,drivers/sensor/*_dummy/
96+ projectBaseDir : thingy91x-oob
8097
81- - name : Run sonar-scanner on PR
82- working-directory : thingy91x-oob
98+ - name : SonarQube Scan on PR
8399 if : github.event_name == 'pull_request'
100+ uses : SonarSource/sonarqube-scan-action@v6.0.0
84101 env :
85102 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
86103 SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
87- PR_NUMBER : ${{ github.event.pull_request.number }}
88- PR_BRANCH : ${{ github.event.pull_request.head.ref }}
89- BASE_REF : ${{ github.event.pull_request.base.ref }}
90- HEAD_SHA : ${{ github.event.pull_request.head.sha }}
91- run : |
92- sonar-scanner \
93- --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}" \
94- --define project.settings=sonar-project.properties \
95- --define sonar.coverageReportPaths=coverage.xml \
96- --define sonar.inclusions=**/*.c,**/*.h \
97- --define sonar.exclusions=tests/,drivers/sensor/*_dummy/ \
98- --define sonar.scm.revision=${{ env.HEAD_SHA }} \
99- --define sonar.pullrequest.key=${{ env.PR_NUMBER }} \
100- --define sonar.pullrequest.branch=${{ env.PR_BRANCH }} \
101- --define sonar.pullrequest.base=${{ env.BASE_REF }}
104+ with :
105+ args : |
106+ --define sonar.cfamily.build-wrapper-output=thingy91x-oob/${{ env.BUILD_WRAPPER_OUT_DIR }}
107+ --define sonar.projectKey=hello-nrfcloud_firmware
108+ --define sonar.organization=hello-nrfcloud-com-firmware
109+ --define sonar.host.url=https://sonarcloud.io
110+ --define sonar.coverageReportPaths=coverage.xml
111+ --define sonar.inclusions=**/*.c,**/*.h
112+ --define sonar.exclusions=tests/,drivers/sensor/*_dummy/
113+ --define sonar.scm.revision=${{ github.event.pull_request.head.sha }}
114+ --define sonar.pullrequest.key=${{ github.event.pull_request.number }}
115+ --define sonar.pullrequest.branch=${{ github.event.pull_request.head.ref }}
116+ --define sonar.pullrequest.base=${{ github.event.pull_request.base.ref }}
117+ projectBaseDir : thingy91x-oob
0 commit comments