-
Notifications
You must be signed in to change notification settings - Fork 47
50 lines (48 loc) · 1.39 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
name: sonarcloud
on:
push:
branches:
- '**'
paths-ignore:
- docs/**
- '**/*.md'
pull_request:
branches:
- '**'
paths-ignore:
- docs/**
- '**/*.md'
jobs:
condition-check:
runs-on: ubuntu-latest
outputs:
ok: ${{ steps.check-secrets.outputs.ok }}
steps:
- name: Secret guard
id: check-secrets
run: |
if [ ! -z "${{ secrets.SONAR_TOKEN }}" ]; then
echo "ok=true" >> $GITHUB_OUTPUT
fi
sonarcloud:
runs-on: ubuntu-latest
needs:
- condition-check
if: ${{ needs.condition-check.outputs.ok == 'true' }}
steps:
- name: Git checkout
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Build with wrapper
uses: docker://ghcr.io/nfrechette/toolchain-amd64-linux-sonarcloud:v3
with:
args: '/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw_output python3 make.py -compiler clang15 -config Release -cpu x64 -build'
- name: Run Sonar Scanner and upload to Sonarcloud
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: https://sonarcloud.io
uses: docker://ghcr.io/nfrechette/toolchain-amd64-linux-sonarcloud:v3
with:
args: '/sonar-scanner-5.0.1.3006-linux/bin/sonar-scanner'