Skip to content

Commit 7323a4c

Browse files
authored
Update build.yml
1 parent 0f9ea80 commit 7323a4c

File tree

1 file changed

+17
-19
lines changed

1 file changed

+17
-19
lines changed

.github/workflows/build.yml

+17-19
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,46 @@
1-
name: SonarCloud
1+
name: Build
2+
23
on:
34
push:
45
branches:
56
- main
6-
pull_request:
7-
types: [opened, synchronize, reopened]
7+
8+
89
jobs:
910
build:
10-
name: Build and analyze
11+
name: Build
1112
runs-on: windows-latest
13+
permissions: read-all
1214
steps:
15+
- uses: actions/checkout@v2
16+
with:
17+
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
1318
- name: Set up JDK 17
14-
uses: actions/setup-java@v3
19+
uses: actions/setup-java@v1
1520
with:
1621
java-version: 17
17-
distribution: 'zulu' # Alternative distribution options are available.
18-
- uses: actions/checkout@v3
19-
with:
20-
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
21-
- name: Cache SonarCloud packages
22-
uses: actions/cache@v3
22+
- name: Cache SonarQube packages
23+
uses: actions/cache@v1
2324
with:
24-
path: ~\sonar\cache
25+
path: ~\.sonar\cache
2526
key: ${{ runner.os }}-sonar
2627
restore-keys: ${{ runner.os }}-sonar
27-
- name: Cache SonarCloud scanner
28+
- name: Cache SonarQube scanner
2829
id: cache-sonar-scanner
29-
uses: actions/cache@v3
30+
uses: actions/cache@v1
3031
with:
3132
path: .\.sonar\scanner
3233
key: ${{ runner.os }}-sonar-scanner
3334
restore-keys: ${{ runner.os }}-sonar-scanner
34-
- name: Install SonarCloud scanner
35+
- name: Install SonarQube scanner
3536
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
3637
shell: powershell
3738
run: |
3839
New-Item -Path .\.sonar\scanner -ItemType Directory
3940
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
4041
- name: Build and analyze
41-
env:
42-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
43-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
4442
shell: powershell
4543
run: |
46-
.\.sonar\scanner\dotnet-sonarscanner begin /k:"lyw912_downkyi" /o:"lyw912" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
44+
.\.sonar\scanner\dotnet-sonarscanner begin /k:"downkyi" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="${{ secrets.SONAR_HOST_URL }}"
4745
dotnet build
4846
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"

0 commit comments

Comments
 (0)