Skip to content

Commit 15f6cbd

Browse files
committed
updated SQ workflow file
1 parent baaa134 commit 15f6cbd

File tree

1 file changed

+34
-34
lines changed

1 file changed

+34
-34
lines changed
+34-34
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
name: 03-SonarQube-Analysis
22

33
on:
4-
#It is an internal tool, it can only ran a self hosted runner. Currently it can be triggered only manually.
4+
# It is an internal tool, it can only run on a self-hosted runner. Currently, it can be triggered only manually.
55
workflow_dispatch:
66

7-
87
jobs:
9-
sonarqube:
10-
runs-on: llbp-bud-lab006
11-
env:
12-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
13-
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
14-
steps:
15-
- name: Checkout code
16-
uses: actions/checkout@v4.2.2
17-
18-
- name: Pull a docker image file
19-
run: docker pull lx0017637.silabs.com:5000/bluetooth-aoa-example-build-env:1.0.0
8+
sonarqube:
9+
runs-on: llbp-bud-lab006
10+
env:
11+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
12+
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
13+
INTERNAL_REPOSITORY_NAME: "lx0017637.silabs.com:5000"
14+
DOCKER_IMAGE: "bluetooth-aoa-example-build-env:1.0.0"
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4.2.2
2018

21-
- name: Run SonarQube analysis
19+
- name: Pull a docker image file
20+
run: docker pull ${{ env.INTERNAL_REPOSITORY_NAME }}/${{ env.DOCKER_IMAGE }}
2221

23-
run: |
24-
docker run -u root --rm -v $(pwd):/home/jenkins/bluetooth-AoA-example lx0017637.silabs.com:5000/bluetooth-AoA-example:1.0.0 /bin/sh -c "
25-
cd bluetooth-AoA-examplec &&
26-
make all &&
27-
rm -rf sonar-bw &&
28-
rm -rf .scannerwork &&
29-
rm -rf locator_ncp/build &&
30-
rm -rf locator_host/build
31-
mkdir sonar-bw &&
32-
/opt/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir sonar-bw/locator_host/ make locator_host &&
33-
/opt/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir sonar-bw/locator_ncp/ make locator_ncp &&
34-
sonar-scanner -Dsonar.token=$SONAR_TOKEN -Dsonar.host.url=$SONAR_HOST_URL"
22+
- name: Run SonarQube analysis
23+
run: |
24+
docker run -u root --rm -v $(pwd):/home/jenkins/bluetooth-aoa-example ${{ env.INTERNAL_REPOSITORY_NAME }}/${{ env.DOCKER_IMAGE }} /bin/sh -c " \
25+
cd bluetooth-aoa-examplec && \
26+
make all && \
27+
rm -rf sonar-bw && \
28+
rm -rf .scannerwork && \
29+
rm -rf locator_ncp/build && \
30+
rm -rf locator_host/build && \
31+
mkdir sonar-bw && \
32+
/opt/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir sonar-bw/locator_host/ make locator_host && \
33+
/opt/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir sonar-bw/locator_ncp/ make locator_ncp && \
34+
sonar-scanner -Dsonar.token=$SONAR_TOKEN -Dsonar.host.url=$SONAR_HOST_URL"
3535
36-
- name: Cleanup leftover files
37-
if: always()
38-
run: |
39-
docker run -u root --rm -v $(pwd):/home/jenkins/bluetooth-AoA-example lx0017637.silabs.com:5000/bluetooth-AoA-example:1.0.0 /bin/sh -c "
40-
rm -rf sonar-bw && \
41-
rm -rf .scannerwork && \
42-
rm -rf locator_ncp/build && \
43-
rm -rf locator_host/build "
36+
- name: Cleanup leftover files
37+
if: always()
38+
run: |
39+
docker run -u root --rm -v $(pwd):/home/jenkins/bluetooth-aoa-example ${{ env.INTERNAL_REPOSITORY_NAME }}/${{ env.DOCKER_IMAGE }} /bin/sh -c "
40+
rm -rf sonar-bw && \
41+
rm -rf .scannerwork && \
42+
rm -rf locator_ncp/build && \
43+
rm -rf locator_host/build "

0 commit comments

Comments
 (0)