1
- # Copyright 2021-2022 MONAI Consortium
2
- # Licensed under the Apache License, Version 2.0 (the "License");
3
- # you may not use this file except in compliance with the License.
4
- # You may obtain a copy of the License at
5
- # http://www.apache.org/licenses/LICENSE-2.0
6
- # Unless required by applicable law or agreed to in writing, software
7
- # distributed under the License is distributed on an "AS IS" BASIS,
8
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
- # See the License for the specific language governing permissions and
10
- # limitations under the License.
1
+ # SPDX-FileCopyrightText: © 2021-2022 MONAI Consortium
2
+ # SPDX-License-Identifier: Apache License 2.0
3
+
11
4
12
5
name : ci
13
6
14
7
on :
15
8
# Triggers on pushes and on pull requests
16
9
push :
17
- branches :
18
- - main
19
- pull_request :
10
+ paths-ignore :
11
+ - ' demos/**'
20
12
21
13
# Allows you to run this workflow manually from the Actions tab
22
14
workflow_dispatch :
@@ -97,17 +89,12 @@ jobs:
97
89
uses : github/codeql-action/analyze@v1
98
90
99
91
unit-test :
100
- runs-on : ${{ matrix.os }}
101
- strategy :
102
- matrix :
103
- os : [ubuntu-latest]
104
- fail-fast : true
105
-
92
+ runs-on : ubuntu-latest
106
93
steps :
107
- - name : Checkout repository
108
- uses : actions/checkout@v2
94
+ - name : Set up JDK 11
95
+ uses : actions/setup-java@v1
109
96
with :
110
- fetch-depth : 0
97
+ java-version : 1.11
111
98
112
99
- uses : actions/setup-dotnet@v1
113
100
with :
@@ -121,18 +108,46 @@ jobs:
121
108
restore-keys : |
122
109
${{ runner.os }}-nuget
123
110
111
+ - uses : actions/checkout@v2
112
+ with :
113
+ fetch-depth : 0
114
+
115
+ - name : Install SonarCloud scanner
116
+ if : steps.cache-sonar-scanner.outputs.cache-hit != 'true'
117
+ run : dotnet tool install --global dotnet-sonarscanner
118
+
124
119
- name : Restore dependencies
125
120
run : dotnet restore
126
121
working-directory : ./src
127
-
128
- - name : Build Solution
129
- run : dotnet build -c ${{ env.BUILD_CONFIG }} --nologo ${{ env.SOLUTION }}
122
+
123
+ - name : Begin SonarScanner
124
+ env :
125
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
126
+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
127
+ run : 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" /d:sonar.cs.opencover.reportsPaths="${{ env.TEST_RESULTS }}/**/*.xml"
130
128
working-directory : ./src
131
-
132
- - name : Run Unit Test
133
- run : dotnet test -c ${{ env.BUILD_CONFIG }} -v=minimal --results-directory "${{ env.TEST_RESULTS }}" --collect:"XPlat Code Coverage" --settings coverlet.runsettings ${{ env.SOLUTION }}
129
+
130
+ - name : Build
131
+ env :
132
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
133
+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
134
+ run : dotnet build -c ${{ env.BUILD_CONFIG }} --nologo "${{ env.SOLUTION }}"
135
+ working-directory : ./src
136
+
137
+ - name : Test
138
+ env :
139
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
140
+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
141
+ run : find ~+ -type f -name "*.Test.csproj" | xargs -L1 dotnet test -c ${{ env.BUILD_CONFIG }} -v=minimal -r "${{ env.TEST_RESULTS }}" --collect:"XPlat Code Coverage" --settings coverlet.runsettings
134
142
working-directory : ./src
135
143
144
+ - name : End SonarScanner
145
+ env :
146
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
147
+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
148
+ run : dotnet sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
149
+ working-directory : ./src
150
+
136
151
- uses : codecov/codecov-action@v2
137
152
with :
138
153
token : ${{ secrets.CODECOV_TOKEN }}
@@ -261,6 +276,26 @@ jobs:
261
276
sarif_file : ${{ steps.anchore-scan.outputs.sarif }}
262
277
token : ${{ secrets.GITHUB_TOKEN }}
263
278
279
+ - name : Integration Test
280
+ env :
281
+ TAG : ${{ env.GitVersion_SemVer }}
282
+ if : ${{ (matrix.os == 'ubuntu-latest') }}
283
+ run : |
284
+ pushd tests/Integration.Test
285
+ ./run.sh
286
+ popd
287
+
288
+ - name : Upload Integration Test Results
289
+
290
+ with :
291
+ name : integration
292
+ path : |
293
+ tests/Integration.Test/LivingDoc.html
294
+ tests/Integration.Test/metrics.log
295
+ tests/Integration.Test/services.log
296
+ tests/Integration.Test/run.log
297
+ retention-days : 30
298
+
264
299
docs :
265
300
runs-on : ubuntu-latest
266
301
needs : [calc-version]
@@ -377,13 +412,13 @@ jobs:
377
412
378
413
- name : Unzip docs
379
414
run : |
380
- mkdir ~/docs
381
- unzip artifacts/mig-docs-${{ env.SEMVER }}.zip -d ~/docs
382
- ls -lR ~/docs
415
+ mkdir userguide
416
+ unzip artifacts/mig-docs-${{ env.SEMVER }}.zip -d userguide/
417
+ ls -lR userguide/
383
418
384
419
- name : Deploy Docs
385
420
uses : peaceiris/actions-gh-pages@v3
386
421
with :
387
422
github_token : ${{ secrets.GITHUB_TOKEN }}
388
- publish_dir : ~/docs
423
+ publish_dir : userguide/
389
424
publish_branch : docs
0 commit comments