-
Notifications
You must be signed in to change notification settings - Fork 3
54 lines (47 loc) · 1.71 KB
/
sonarcloud.yml
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
---
name: sonarcloud
on: [push]
jobs:
sonarcloud:
name: SonarCloud
runs-on: ubuntu-22.04
steps:
- name: Cache SonarCloud packages
uses: actions/cache@v1
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Download and set up sonar-scanner
env:
SONAR_SCANNER_VERSION: 4.7.0.2747
SONAR_SCANNER_DOWNLOAD_URL: |
https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.7.0.2747-linux.zip
run: |
mkdir -p "$HOME/.sonar"
curl -sSLo "$HOME/.sonar/sonar-scanner.zip" \
${{ env.SONAR_SCANNER_DOWNLOAD_URL }}
unzip -o "$HOME/.sonar/sonar-scanner.zip" -d "$HOME/.sonar/"
SCANNER_DIR="sonar-scanner-${{ env.SONAR_SCANNER_VERSION }}-linux"
echo "$HOME/.sonar/$SCANNER_DIR/bin" >> "$GITHUB_PATH"
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0 # Shallow clones should be disabled for a better
# relevancy of analysis
- name: Setup dependencies
run: |
sudo add-apt-repository -y 'ppa:mhier/libboost-latest'
sudo apt-get install -y boost1.74
- name: Produce Compilation Database
shell: bash
run: |
cmake . -DCMAKE_BUILD_TYPE=Debug
- name: SonarCloud Scan
env:
# Needed to get PR information, if any
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_SERVER_URL: "https://sonarcloud.io"
run: |
sonar-scanner --define sonar.host.url="${{ env.SONAR_SERVER_URL }}"