This repository has been archived by the owner on Oct 16, 2024. It is now read-only.
Update dependency mini-css-extract-plugin to v2 #2754
This file contains 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 Build and Test | |
on: | |
push: | |
branches: [ main ] | |
paths: | |
- 'Dfe.PrepareTransfers.*/**' | |
- '!end-to-end-tests/**' | |
pull_request: | |
branches: [ main ] | |
types: [ opened, synchronize, reopened] | |
paths: | |
- 'Dfe.PrepareTransfers.*/**' | |
- '!end-to-end-tests/**' | |
env: | |
DOTNET_VERSION: '8.0.x' | |
JAVA_VERSION: '17' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Shallow clones disabled for a better relevancy of SC analysis | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: ${{ env.DOTNET_VERSION }} | |
- name: Setup JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'microsoft' | |
java-version: ${{ env.JAVA_VERSION }} | |
- name: Cache SonarCloud packages | |
uses: actions/cache@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: 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 Dfe.PrepareTransfers.Web | |
run: make build-frontend | |
- name: Build, Test and Analyze | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
run: | | |
dotnet-sonarscanner begin /k:"DFE-Digital_prepare-academy-transfers" /o:"dfe-digital" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.coverageReportPaths=CoverageReport/SonarQube.xml | |
dotnet build -c Release --no-restore | |
dotnet test -c Release --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 }}" |