Skip to content

137748 cypress sponsored pupil forecasts #3502

137748 cypress sponsored pupil forecasts

137748 cypress sponsored pupil forecasts #3502

Workflow file for this run

name: Pull request checks
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
types: [opened, synchronize, reopened]
env:
JAVA_VERSION: '17'
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones disabled for a better relevancy of SC analysis
- name: lint cypress tests
run: |
cd Dfe.PrepareConversions/Dfe.PrepareConversions.CypressTests
npm ci
npm run lint
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones disabled for a better relevancy of SC analysis
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.403
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: 'microsoft'
- name: Cache SonarCloud packages
uses: actions/cache@v1
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 Dfe.PrepareConversions/Dfe.PrepareConversions.sln
- name: Build, Test and Analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
dotnet-sonarscanner begin /k:"DFE-Digital-prepare-conversions" /o:"dfe-digital" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.coverageReportPaths=CoverageReport/SonarQube.xml
dotnet build Dfe.PrepareConversions/Dfe.PrepareConversions.sln --no-restore
dotnet test Dfe.PrepareConversions/Dfe.PrepareConversions.sln --no-build --verbosity normal --collect:"XPlat Code Coverage"
reportgenerator -reports:./**/coverage.cobertura.xml -targetdir:./Dfe.PrepareConversions/CoverageReport -reporttypes:SonarQube
dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"