Skip to content

Commit 60f9cf6

Browse files
committedMar 14, 2025··
Adds Sonar Workflow
1 parent 164346d commit 60f9cf6

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed
 

‎.github/workflows/analyze.yaml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Analyze
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
9+
jobs:
10+
build:
11+
name: Build and analyze
12+
runs-on: windows-latest
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
- name: Set up JDK 17
19+
uses: actions/setup-java@v4
20+
with:
21+
java-version: 17
22+
distribution: 'zulu'
23+
- name: Cache SonarQube packages
24+
uses: actions/cache@v4
25+
with:
26+
path: ~\.sonar\cache
27+
key: ${{ runner.os }}-sonar
28+
restore-keys: ${{ runner.os }}-sonar
29+
- name: Cache SonarQube scanner
30+
id: cache-sonar-scanner
31+
uses: actions/cache@v4
32+
with:
33+
path: .\.sonar\scanner
34+
key: ${{ runner.os }}-sonar-scanner
35+
restore-keys: ${{ runner.os }}-sonar-scanner
36+
- name: Install SonarQube scanner
37+
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
38+
shell: powershell
39+
run: |
40+
New-Item -Path .\.sonar\scanner -ItemType Directory
41+
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
42+
- name: Build and analyze
43+
shell: powershell
44+
run: |
45+
.\.sonar\scanner\dotnet-sonarscanner begin /k:"sp-tarkov_assembly-tool_b6343d33-dd80-43a0-bee2-331100b50832" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="${{ secrets.SONAR_HOST_URL }}"
46+
dotnet build
47+
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"

0 commit comments

Comments
 (0)
Please sign in to comment.