Skip to content

Bump ossf/scorecard-action from 2.3.0 to 2.3.1 #935

Bump ossf/scorecard-action from 2.3.0 to 2.3.1

Bump ossf/scorecard-action from 2.3.0 to 2.3.1 #935

Workflow file for this run

name: lighthouse
on:
pull_request:
branches:
- main
- dotnet-vnext
- dotnet-nightly
workflow_dispatch:
permissions:
contents: read
env:
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_MULTILEVEL_LOOKUP: 0
DOTNET_NOLOGO: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION: 1
NUGET_XMLDOC_MODE: skip
TERM: xterm
jobs:
lighthouse:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup .NET SDK
uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # v3.2.0
- name: Start website
shell: pwsh
env:
Site__Authentication__UserStore__AccessKey: C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==
Site__Authentication__UserStore__ServiceUri: https://localhost:8081
run: |
Push-Location (Join-Path "src" "LondonTravel.Site")
npm ci
npm run build
Pop-Location
dotnet build ./src/LondonTravel.Site/LondonTravel.Site.csproj --configuration Release
Start-Process nohup 'dotnet run --project ./src/LondonTravel.Site/LondonTravel.Site.csproj --configuration Release'
$StatusCode = 0
$Attempts = 0
While ($Attempts -lt 10) {
$Response = Try {
Invoke-WebRequest "https://localhost:5001" -SkipCertificateCheck
} catch {
$_.Exception.Response
}
$StatusCode = $Response.StatusCode
If ($StatusCode -eq 200) {
break
}
$Attempts++
Start-Sleep -Seconds 5
}
If ($StatusCode -ne 200) {
throw "Failed to successfully connect to website after $Attempts attempts."
}
New-Item -Path "${env:GITHUB_WORKSPACE}/artifacts/lighthouse" -ItemType Directory | Out-Null
- name: Lighthouse
uses: foo-software/lighthouse-check-action@f78f162ef0ecd48a18244c427959f0b79ef4d553 # v10.0.0
id: lighthouse
with:
device: 'all'
gitHubAccessToken: ${{ secrets.LIGHTHOUSE_ACCESS_TOKEN }}
outputDirectory: ${{ github.workspace }}/artifacts/lighthouse
prCommentEnabled: true
urls: 'https://localhost:5001'
wait: true
- name: Check Lighthouse scores
uses: foo-software/lighthouse-check-status-action@f22f8cdcaf593a986749d39fe21382526de3f501 # v2.0.1
with:
lighthouseCheckResults: ${{ steps.lighthouse.outputs.lighthouseCheckResults }}
minAccessibilityScore: "90"
minBestPracticesScore: "83"
minPerformanceScore: "71"
minProgressiveWebAppScore: "85"
minSeoScore: "100"
- name: Publish artifacts
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
if: ${{ always() }}
with:
name: lighthouse
path: ${{ github.workspace }}/artifacts/lighthouse
if-no-files-found: ignore