Consume .NET nightly builds #2579
Workflow file for this run
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: lighthouse | |
on: | |
pull_request: | |
branches: | |
- main | |
- dotnet-vnext | |
- dotnet-nightly | |
workflow_dispatch: | |
permissions: | |
contents: read | |
env: | |
APPLICATION_URL: 'https://localhost:50001' | |
DOTNET_CLI_TELEMETRY_OPTOUT: true | |
DOTNET_NOLOGO: true | |
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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Setup .NET SDK | |
uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # v4.0.1 | |
- name: Start website | |
shell: pwsh | |
env: | |
APPLICATION_URL: ${{ env.APPLICATION_URL }} | |
ConnectionStrings__AzureServiceBus: 'costellobot.servicebus.windows.local' | |
GitHub__ClientId: 'github-client-id' | |
GitHub__ClientSecret: 'github-client-secret' | |
Logging__LogLevel__Azure: 'None' | |
run: | | |
Start-Process nohup 'dotnet run --project ./src/Costellobot/Costellobot.csproj --configuration Release /p:EnableNETAnalyzers=false /p:EnforceCodeStyleInBuild=false' | |
$StatusCode = 0 | |
$Attempts = 0 | |
While ($Attempts -lt 20) { | |
$Response = Try { | |
Invoke-WebRequest ${env:APPLICATION_URL} -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@a80267da2e0244b8a2e457a8575fc47590615852 # v12.0.1 | |
id: lighthouse | |
with: | |
device: 'all' | |
gitHubAccessToken: ${{ secrets.LIGHTHOUSE_ACCESS_TOKEN }} | |
outputDirectory: ${{ github.workspace }}/artifacts/lighthouse | |
prCommentEnabled: true | |
urls: ${{ env.APPLICATION_URL }} | |
wait: true | |
- name: Check Lighthouse scores | |
uses: foo-software/lighthouse-check-status-action@2b9d5101f7a0de86ddb153a0d77ad7046aac1052 # v3.0.1 | |
with: | |
lighthouseCheckResults: ${{ steps.lighthouse.outputs.lighthouseCheckResults }} | |
minAccessibilityScore: "93" | |
minBestPracticesScore: "92" | |
minPerformanceScore: "95" | |
minProgressiveWebAppScore: "50" | |
minSeoScore: "60" | |
- name: Publish artifacts | |
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 | |
if: ${{ !cancelled() }} | |
with: | |
name: lighthouse | |
path: ${{ github.workspace }}/artifacts/lighthouse | |
if-no-files-found: ignore |