-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (67 loc) · 2.63 KB
/
Copy pathsonarcloud.yml
File metadata and controls
79 lines (67 loc) · 2.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Sonarcloud
on:
workflow_call:
workflow_dispatch:
pull_request:
types: [opened, synchronize, reopened]
paths:
- '**/*.c'
- '**/*.h'
- .github/workflows/sonarcloud.yml
- sonar-project.properties
- west.yml
- '**/CMakeLists.txt'
- '**/Kconfig*'
- '**/prj.conf'
permissions:
contents: read
pull-requests: write
concurrency:
group: sonarcloud-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
jobs:
analyze:
name: Build and analyze
runs-on: self-hosted
container: ghcr.io/zephyrproject-rtos/ci:v0.29.2
env:
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory
CMAKE_PREFIX_PATH: /opt/toolchains
steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
fetch-depth: 0
path: serial-modem-host-applications
- name: Fetch base branch for SonarCloud PR analysis
if: github.event_name == 'pull_request'
working-directory: serial-modem-host-applications
run: git fetch origin ${{ github.base_ref }}:${{ github.base_ref }}
- name: Initialize West workspace
uses: ./serial-modem-host-applications/.github/actions/west-init
- name: Install build wrapper dependencies
run: |
apt-get update && apt-get install --no-install-recommends -y curl
- name: Install Build Wrapper
uses: SonarSource/sonarqube-scan-action/install-build-wrapper@299e4b793aaa83bf2aba7c9c14bedbb485688ec4 # v7.1.0
- name: Build with build wrapper
working-directory: serial-modem-host-applications/applications
run: |
cd 91m1_ppp
build-wrapper-linux-x86-64 --out-dir ../../${{ env.BUILD_WRAPPER_OUT_DIR }} \
west build -b nrf54l15dk/nrf54l15/cpuapp/ns -p
cd ../93m1_ppp
build-wrapper-linux-x86-64 --out-dir ../../${{ env.BUILD_WRAPPER_OUT_DIR }} \
west build -b nrf93m1dk/nrf54l15/cpuapp/ns -p
cd ../93m1_at
build-wrapper-linux-x86-64 --out-dir ../../${{ env.BUILD_WRAPPER_OUT_DIR }} \
west build -b nrf93m1dk/nrf54l15/cpuapp/ns -p
- name: SonarQube Scan
uses: SonarSource/sonarqube-scan-action@299e4b793aaa83bf2aba7c9c14bedbb485688ec4 # v7.1.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: |
--define sonar.cfamily.compile-commands=serial-modem-host-applications/${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json
projectBaseDir: serial-modem-host-applications