-
Notifications
You must be signed in to change notification settings - Fork 9
66 lines (54 loc) · 1.95 KB
/
sonar_analysis.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
name: CI
on:
pull_request:
types: [opened, edited, reopened, synchronize]
workflow_dispatch:
env:
GH_TOKEN: ${{ secrets.GIT_TOKEN_SECRET }}
OWNER: ${{ github.repository_owner }}
REPO: ${{ github.event.repository.name }}
PR_NUMBER: ${{ github.event.number }}
SONAR_HOST_URL: "https://sonarqube.trustly.one"
SONAR_TOKEN: ${{secrets.SONAR_TOKEN_SECRET}}
SONAR_PROJECT_KEY: "trustly-ios"
SONAR_PROJECT_NAME: "trustly-ios"
jobs:
SonarQube:
runs-on: macOS-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install CocoaPods
run: |
gem install cocoapods
pod install --project-directory=Example
- name: Install Bear
run: |
brew install bear
- name: Run Build with Build-Wrapper
run: |
bear -- xcodebuild -workspace Example/TrustlySDK.xcworkspace \
-scheme TrustlySDK-Example \
-destination 'platform=iOS Simulator,name=iPhone 15,OS=17.4' \
build build OTHER_CFLAGS="-fsyntax-only"
- name: Install sonar-scanner
run: |
brew install sonar-scanner
- name: Run SonarQube Analysis
run: |
sonar-scanner -X \
-Dsonar.host.url=${SONAR_HOST_URL} \
-Dsonar.login=${SONAR_TOKEN} \
-Dsonar.projectKey=${SONAR_PROJECT_KEY} \
-Dsonar.projectName=${SONAR_PROJECT_NAME} \
-Dsonar.pullrequest.base="${{ github.base_ref }}" \
-Dsonar.pullrequest.branch="${{ github.head_ref }}" \
-Dsonar.pullrequest.key="${{ github.event.pull_request.number }}" \
-Dsonar.scm.revision="${{ github.event.pull_request.head.sha }}" \
-Dsonar.scm.disabled=true \
-Dsonar.language=swift \
-Dsonar.sources="." \
-Dsonar.verbose=true \
-Dsonar.cfamily.compile-commands=compile_commands.json