SonarQube Analysis #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: SonarQube Analysis | |
on: | |
pull_request: | |
branches: | |
- master | |
workflow_dispatch: | |
jobs: | |
sonarqube: | |
runs-on: llbp-bud-lab006 | |
env: | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4.2.2 | |
- name: Pull a docker image file | |
run: docker pull lx0017637.silabs.com:5000/devs_identec_xg24_aoa_poc:1.0.0 | |
- name: Run SonarQube analysis | |
run: | | |
docker run -u root --rm -v $(pwd):/home/jenkins/devs_identec_xg24_aoa_poc lx0017637.silabs.com:5000/devs_identec_xg24_aoa_poc:1.0.0 /bin/sh -c " | |
cd devs_identec_xg24_aoa_poc && | |
make all && | |
rm -rf sonar-bw && | |
rm -rf .scannerwork && | |
rm -rf locator_ncp/build && | |
rm -rf locator_host/build | |
mkdir sonar-bw && | |
/opt/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir sonar-bw/locator_host/ make locator_host && | |
/opt/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir sonar-bw/locator_ncp/ make locator_ncp && | |
sonar-scanner -Dsonar.token=$SONAR_TOKEN -Dsonar.host.url=$SONAR_HOST_URL" | |
- name: Cleanup leftover files | |
if: always() | |
run: | | |
docker run -u root --rm -v $(pwd):/home/jenkins/devs_identec_xg24_aoa_poc lx0017637.silabs.com:5000/devs_identec_xg24_aoa_poc:1.0.0 /bin/sh -c " | |
rm -rf sonar-bw && \ | |
rm -rf .scannerwork && \ | |
rm -rf locator_ncp/build && \ | |
rm -rf locator_host/build " |