Update github/codeql-action digest to 5c8a8a6 #4564
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: .NET | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| env: | |
| JAVA_VERSION: 21 | |
| DOTNET_VERSION: 8.0.x | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
| - name: lint cypress tests | |
| run: | | |
| cd CypressTests | |
| npm ci | |
| npm run lint | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
| with: | |
| fetch-depth: 0 # Shallow clones disabled for a better relevancy of SC analysis | |
| - name: Setup .NET ${{ env.DOTNET_VERSION }} | |
| uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4 | |
| with: | |
| dotnet-version: ${{ env.DOTNET_VERSION }} | |
| - name: Setup JDK ${{ env.JAVA_VERSION }} | |
| uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4 | |
| with: | |
| java-version: ${{ env.JAVA_VERSION }} | |
| distribution: 'microsoft' | |
| - name: Cache SonarCloud packages | |
| uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4 | |
| with: | |
| path: ~\sonar\cache | |
| key: ${{ runner.os }}-sonar | |
| restore-keys: ${{ runner.os }}-sonar | |
| - name: Install SonarCloud scanners | |
| run: dotnet tool install --global dotnet-sonarscanner | |
| - name: Install EF for tests | |
| run: dotnet tool install --global dotnet-ef | |
| - name: Install dotnet reportgenerator | |
| run: dotnet tool install --global dotnet-reportgenerator-globaltool | |
| - name: Add nuget package source | |
| run: dotnet nuget add source --username USERNAME --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/DFE-Digital/index.json" | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Build, Test and Analyze | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| run: | | |
| dotnet-sonarscanner begin /d:sonar.qualitygate.wait=true /k:"DFE-Digital_academies-academisation-api" /o:"dfe-digital" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.scanner.skipJreProvisioning=true /d:sonar.host.url="https://sonarcloud.io" /d:sonar.coverageReportPaths=CoverageReport/SonarQube.xml | |
| dotnet build --no-restore | |
| dotnet test --no-build --verbosity normal --collect:"XPlat Code Coverage" | |
| reportgenerator -reports:./**/coverage.cobertura.xml -targetdir:./CoverageReport -reporttypes:SonarQube | |
| dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" |