1
- # SPDX-FileCopyrightText: © 2021-2022 MONAI Consortium
1
+ # SPDX-FileCopyrightText: � 2021-2022 MONAI Consortium
2
2
# SPDX-License-Identifier: Apache License 2.0
3
3
4
4
@@ -59,14 +59,42 @@ jobs:
59
59
language : [ 'csharp' ]
60
60
61
61
steps :
62
+ - name : Set up JDK 11
63
+ uses : actions/setup-java@v1
64
+ with :
65
+ java-version : 1.11
66
+
62
67
- name : Checkout repository
63
68
uses : actions/checkout@v2
64
69
with :
65
70
fetch-depth : 0
71
+
66
72
- uses : actions/setup-dotnet@v1
67
73
with :
68
74
dotnet-version : " 6.0.x"
69
75
76
+ - name : Cache SonarCloud packages
77
+ uses : actions/cache@v1
78
+ with :
79
+ path : ~\sonar\cache
80
+ key : ${{ runner.os }}-sonar
81
+ restore-keys : ${{ runner.os }}-sonar
82
+
83
+ - name : Cache SonarCloud scanner
84
+ id : cache-sonar-scanner
85
+ uses : actions/cache@v1
86
+ with :
87
+ path : .\.sonar\scanner
88
+ key : ${{ runner.os }}-sonar-scanner
89
+ restore-keys : ${{ runner.os }}-sonar-scanner
90
+
91
+ - name : Install SonarCloud scanner
92
+ if : steps.cache-sonar-scanner.outputs.cache-hit != 'true'
93
+ shell : powershell
94
+ run : |
95
+ New-Item -Path .\.sonar\scanner -ItemType Directory
96
+ dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
97
+
70
98
- name : Enable NuGet cache
71
99
72
100
with :
@@ -85,7 +113,14 @@ jobs:
85
113
working-directory : ./src
86
114
87
115
- name : Build Solution
88
- run : dotnet build -c ${{ env.BUILD_CONFIG }} --nologo ${{ env.SOLUTION }}
116
+ env :
117
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
118
+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
119
+ shell : powershell
120
+ run : |
121
+ .\.sonar\scanner\dotnet-sonarscanner begin /k:"Project-MONAI_monai-deploy-informatics-gateway" /o:"project-monai" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
122
+ dotnet build -c ${{ env.BUILD_CONFIG }} --nologo ${{ env.SOLUTION }}
123
+ .\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
89
124
working-directory : ./src
90
125
91
126
- name : Perform CodeQL Analysis
0 commit comments