Moved to baseflow runner and added sonarcloud #124
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Unit Test Dstv reader | |
| on: | |
| push: | |
| branches: [ develop, main ] | |
| pull_request: | |
| branches: [ develop, main ] | |
| jobs: | |
| build_test_dstv_net: | |
| runs-on: baseflow-runner | |
| steps: | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 17 | |
| distribution: 'zulu' | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Cache SonarQube Cloud packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~\sonar\cache | |
| key: ${{ runner.os }}-sonar | |
| restore-keys: ${{ runner.os }}-sonar | |
| - name: Cache SonarQube Cloud scanner | |
| id: cache-sonar-scanner | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ runner.temp }}\scanner | |
| key: ${{ runner.os }}-sonar-scanner | |
| restore-keys: ${{ runner.os }}-sonar-scanner | |
| - name: Install SonarQube Cloud scanner | |
| if: steps.cache-sonar-scanner.outputs.cache-hit != 'true' | |
| shell: powershell | |
| run: | | |
| New-Item -Path ${{ runner.temp }}\scanner -ItemType Directory | |
| dotnet tool update dotnet-sonarscanner --tool-path ${{ runner.temp }}\scanner | |
| - name: Build and analyze | |
| env: | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| shell: powershell | |
| run: | | |
| ${{ runner.temp }}\scanner\dotnet-sonarscanner begin /k:"Baseflow_DSTV.Net" /o:"baseflow" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" | |
| dotnet build | |
| ${{ runner.temp }}\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: | | |
| 6.0.x | |
| 7.0.x | |
| 8.0.x | |
| 9.0.x | |
| - name: Restore dependencies | |
| run: dotnet restore DSTV.Net.sln | |
| - name: Build | |
| run: dotnet build DSTV.Net.sln --no-restore | |
| - name: Test | |
| run: dotnet test DSTV.Net.sln --no-build --verbosity normal |