|
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 |
|
@@ -138,6 +138,45 @@ jobs:
|
138 | 138 | fail_ci_if_error: true
|
139 | 139 | verbose: true
|
140 | 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 | + - uses: actions/checkout@v2 |
| 149 | + with: |
| 150 | + fetch-depth: 0 |
| 151 | + - name: Cache SonarCloud packages |
| 152 | + uses: actions/cache@v1 |
| 153 | + with: |
| 154 | + path: ~\sonar\cache |
| 155 | + key: ${{ runner.os }}-sonar |
| 156 | + restore-keys: ${{ runner.os }}-sonar |
| 157 | + - name: Cache SonarCloud scanner |
| 158 | + id: cache-sonar-scanner |
| 159 | + uses: actions/cache@v1 |
| 160 | + with: |
| 161 | + path: .\.sonar\scanner |
| 162 | + key: ${{ runner.os }}-sonar-scanner |
| 163 | + restore-keys: ${{ runner.os }}-sonar-scanner |
| 164 | + - name: Install SonarCloud scanner |
| 165 | + if: steps.cache-sonar-scanner.outputs.cache-hit != 'true' |
| 166 | + shell: powershell |
| 167 | + run: | |
| 168 | + New-Item -Path .\.sonar\scanner -ItemType Directory |
| 169 | + dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner |
| 170 | + - name: Build and analyze |
| 171 | + env: |
| 172 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 173 | + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
| 174 | + shell: powershell |
| 175 | + 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" |
| 177 | + dotnet build -c ${{ env.BUILD_CONFIG }} --nologo "src\${{ env.SOLUTION }}" |
| 178 | + .\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}" |
| 179 | +
|
141 | 180 | build:
|
142 | 181 | runs-on: ${{ matrix.os }}
|
143 | 182 | needs: [calc-version]
|
|
0 commit comments