Skip to content

Merge branch 'main' of https://github.com/DFE-Digital/flexforms-web #12

Merge branch 'main' of https://github.com/DFE-Digital/flexforms-web

Merge branch 'main' of https://github.com/DFE-Digital/flexforms-web #12

Workflow file for this run

name: .NET
on:
push:
branches: [ main ]
pull_request:
env:
JAVA_VERSION: '21'
DOTNET_VERSION: '10.0.x'
jobs:
build:
name: Build, Test and Analyse
runs-on: ubuntu-24.04
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: Set up 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 dotnet reportgenerator
run: dotnet tool install --global dotnet-reportgenerator-globaltool
- name: Restore dependencies
run: dotnet restore GovUK.Dfe.FlexForms.Web.sln
- 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 /d:sonar.scanner.skipJreProvisioning=true /k:"DFE-Digital_external-applications-web" /o:"dfe-digital" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
dotnet build GovUK.Dfe.FlexForms.Web.sln --no-restore
dotnet test GovUK.Dfe.FlexForms.Web.sln --no-build --verbosity normal --collect:"XPlat Code Coverage"
dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"