@@ -90,19 +90,15 @@ jobs:
90
90
91
91
- name : Perform CodeQL Analysis
92
92
uses : github/codeql-action/analyze@v1
93
+
93
94
94
95
unit-test :
95
- runs-on : ${{ matrix.os }}
96
- strategy :
97
- matrix :
98
- os : [ubuntu-latest]
99
- fail-fast : true
100
-
96
+ runs-on : windows-latest
101
97
steps :
102
- - name : Checkout repository
103
- uses : actions/checkout@v2
98
+ - name : Set up JDK 11
99
+ uses : actions/setup-java@v1
104
100
with :
105
- fetch-depth : 0
101
+ java-version : 1.11
106
102
107
103
- uses : actions/setup-dotnet@v1
108
104
with :
@@ -116,57 +112,36 @@ jobs:
116
112
restore-keys : |
117
113
${{ runner.os }}-nuget
118
114
119
- - name : Restore dependencies
120
- run : dotnet restore
121
- working-directory : ./src
122
-
123
- - name : Build Solution
124
- run : dotnet build -c ${{ env.BUILD_CONFIG }} --nologo ${{ env.SOLUTION }}
125
- working-directory : ./src
126
-
127
- - name : Run Unit Test
128
- run : dotnet test --filter FullyQualifiedName\!~Monai.Deploy.InformaticsGateway.Integration.Test -c ${{ env.BUILD_CONFIG }} -v=minimal --results-directory "${{ env.TEST_RESULTS }}" --collect:"XPlat Code Coverage" --settings coverlet.runsettings ${{ env.SOLUTION }}
129
- working-directory : ./src
130
-
131
- - uses : codecov/codecov-action@v2
132
- with :
133
- token : ${{ secrets.CODECOV_TOKEN }}
134
- directory : " src/${{ env.TEST_RESULTS }}"
135
- files : " **/coverage.opencover.xml"
136
- flags : unittests
137
- name : codecov-umbrella
138
- fail_ci_if_error : true
139
- verbose : true
140
-
141
- sonar-qube :
142
- runs-on : windows-latest
143
- steps :
144
- - name : Set up JDK 11
145
- uses : actions/setup-java@v1
146
- with :
147
- java-version : 1.11
148
115
- uses : actions/checkout@v2
149
116
with :
150
117
fetch-depth : 0
118
+
151
119
- name : Cache SonarCloud packages
152
120
uses : actions/cache@v1
153
121
with :
154
122
path : ~\sonar\cache
155
123
key : ${{ runner.os }}-sonar
156
124
restore-keys : ${{ runner.os }}-sonar
125
+
157
126
- name : Cache SonarCloud scanner
158
127
id : cache-sonar-scanner
159
128
uses : actions/cache@v1
160
129
with :
161
130
path : .\.sonar\scanner
162
131
key : ${{ runner.os }}-sonar-scanner
163
132
restore-keys : ${{ runner.os }}-sonar-scanner
133
+
164
134
- name : Install SonarCloud scanner
165
135
if : steps.cache-sonar-scanner.outputs.cache-hit != 'true'
166
136
shell : powershell
167
137
run : |
168
138
New-Item -Path .\.sonar\scanner -ItemType Directory
169
- dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
139
+ dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
140
+
141
+ - name : Restore dependencies
142
+ run : dotnet restore
143
+ working-directory : ./src
144
+
170
145
- name : Build and analyze
171
146
env :
172
147
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
@@ -177,6 +152,22 @@ jobs:
177
152
dotnet build -c ${{ env.BUILD_CONFIG }} --nologo "src\${{ env.SOLUTION }}"
178
153
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
179
154
155
+ - name : Run Unit Test
156
+ .\.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"
157
+ run : dotnet test --filter FullyQualifiedName\!~Monai.Deploy.InformaticsGateway.Integration.Test -c ${{ env.BUILD_CONFIG }} -v=minimal --results-directory "${{ env.TEST_RESULTS }}" --collect:"XPlat Code Coverage" --settings coverlet.runsettings "src\${{ env.SOLUTION }}"
158
+ .\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
159
+
160
+
161
+ - uses : codecov/codecov-action@v2
162
+ with :
163
+ token : ${{ secrets.CODECOV_TOKEN }}
164
+ directory : " src/${{ env.TEST_RESULTS }}"
165
+ files : " **/coverage.opencover.xml"
166
+ flags : unittests
167
+ name : codecov-umbrella
168
+ fail_ci_if_error : true
169
+ verbose : true
170
+
180
171
build :
181
172
runs-on : ${{ matrix.os }}
182
173
needs : [calc-version]
0 commit comments