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