forked from project-topaz/topaz
-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (55 loc) · 2.17 KB
/
analyse.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
55
56
57
58
59
60
61
62
63
64
65
66
name: analyse
on:
workflow_dispatch: # Manual triggering from Actions > analyse > Run workflow
jobs:
sonarcloud:
name: "SonarCloud Scan"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y software-properties-common wget cmake libmariadb-dev-compat libluajit-5.1-dev libzmq3-dev zlib1g-dev libssl-dev
- name: Configure CMake
run: |
cmake .
- name: Download Sonar Build Wrapper
run: |
wget -c https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip
unzip build-wrapper-linux-x86.zip
cp ./build-wrapper-linux-x86/* ./
- name: Build Wrapped Binaries
run: |
./build-wrapper-linux-x86-64 --out-dir . make -j $(nproc)
- name: Extract git info
run: |
GIT_TAG=`git describe --abbrev=0`
echo "GIT_TAG=${GIT_TAG}" >> $GITHUB_ENV
echo $GIT_TAG
GIT_BRANCH=`git branch --show-current`
echo "GIT_BRANCH=${GIT_BRANCH}" >> $GITHUB_ENV
echo $GIT_BRANCH
GIT_FULL_REPO_NAME=`git rev-parse --show-toplevel`
GIT_REPO_NAME=`basename $GIT_FULL_REPO_NAME`
echo "GIT_REPO_NAME=${GIT_REPO_NAME}" >> $GITHUB_ENV
echo $GIT_REPO_NAME
- name: Setup Sonar
uses: warchant/setup-sonar-scanner@v3
- name: Run Sonar Scanner
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: sonar-scanner
-Dsonar.login=${{ secrets.SONAR_TOKEN }}
-Dsonar.organization=${{ github.repository_owner }}
-Dsonar.projectKey=${{ github.repository_owner }}_${{ env.GIT_REPO_NAME }}
-Dsonar.branch.name=${{ env.GIT_BRANCH }}
-Dsonar.projectVersion=${{ env.GIT_TAG }}
-Dsonar.host.url=https://sonarcloud.io/
-Dsonar.sources=src
-Dsonar.exclusions=src/common/detour/**/*,src/common/fmt/**/*,src/common/lua/**/*,src/common/recast/**/*
-Dsonar.cfamily.build-wrapper-output=.
-Dsonar.cfamily.threads=2
-Dsonar.cfamily.cache.enabled=false