Update .NET SDK to 9.0.100-preview.4.24216.20 #3961
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: build | |
on: | |
push: | |
branches: [ main ] | |
paths-ignore: | |
- '**/*.gitattributes' | |
- '**/*.gitignore' | |
- '**/*.md' | |
pull_request: | |
branches: | |
- main | |
- dotnet-vnext | |
- dotnet-nightly | |
workflow_dispatch: | |
env: | |
APPLICATION_URL_DEV: https://londontravel-dev.martincostello.com | |
APPLICATION_URL_PROD: https://londontravel.martincostello.com | |
AZURE_WEBAPP_NAME: londontravelmartincostello | |
DOTNET_CLI_TELEMETRY_OPTOUT: true | |
DOTNET_GENERATE_ASPNET_CERTIFICATE: false | |
DOTNET_MULTILEVEL_LOOKUP: 0 | |
DOTNET_NOLOGO: true | |
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 | |
DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION: 1 | |
FORCE_COLOR: 1 | |
NUGET_XMLDOC_MODE: skip | |
PUBLISH_RUNTIME: win-x64 | |
TERM: xterm | |
permissions: | |
contents: read | |
jobs: | |
build: | |
name: ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: macos-latest | |
os-name: macos | |
- os: ubuntu-latest | |
os-name: linux | |
- os: windows-latest | |
os-name: windows | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 | |
- name: Setup .NET SDK | |
uses: actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3 # v4.0.0 | |
- name: Setup Node | |
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 | |
with: | |
node-version: '20' | |
- name: Get npm cache directory | |
id: npm-cache-dir | |
shell: pwsh | |
run: echo "dir=$(npm config get cache)" >> ${env:GITHUB_OUTPUT} | |
- name: Setup npm cache | |
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 | |
id: npm-cache | |
with: | |
path: ${{ steps.npm-cache-dir.outputs.dir }} | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: ${{ runner.os }}-node- | |
- name: Setup NuGet cache | |
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 | |
with: | |
path: ~/.nuget/packages | |
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.props') }} | |
restore-keys: ${{ runner.os }}-nuget- | |
- name: Setup Playwright cache | |
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 | |
with: | |
key: ${{ runner.os }}-playwright-${{ hashFiles('Directory.Packages.props') }} | |
path: | | |
~/AppData/Local/ms-playwright | |
~/.cache/ms-playwright | |
~/Library/Caches/ms-playwright | |
- name: Build, test and publish | |
shell: pwsh | |
run: ./build.ps1 -Runtime "${env:PUBLISH_RUNTIME}" | |
- uses: codecov/codecov-action@84508663e988701840491b86de86b666e8a86bed # v4.3.0 | |
name: Upload coverage to Codecov | |
with: | |
file: ./artifacts/coverage/coverage.cobertura.xml | |
flags: ${{ matrix.os-name }} | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- name: Publish artifacts | |
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 | |
if: runner.os == 'Windows' && success() | |
with: | |
name: webapp | |
path: ./artifacts/publish/LondonTravel.Site/release_${{ env.PUBLISH_RUNTIME }} | |
if-no-files-found: error | |
- name: Publish screenshots | |
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 | |
if: ${{ !cancelled() }} | |
with: | |
name: screenshots-${{ matrix.os-name }} | |
path: ./artifacts/screenshots/* | |
if-no-files-found: ignore | |
- name: Publish traces | |
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 | |
if: ${{ !cancelled() }} | |
with: | |
name: traces-${{ matrix.os-name }} | |
path: ./artifacts/traces/* | |
if-no-files-found: ignore | |
- name: Publish videos | |
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 | |
if: ${{ !cancelled() }} | |
with: | |
name: videos-${{ matrix.os-name }} | |
path: ./artifacts/videos/* | |
if-no-files-found: ignore | |
deploy-dev: | |
if: github.event.repository.fork == false && github.ref_name == github.event.repository.default_branch | |
name: dev | |
needs: build | |
runs-on: windows-latest | |
concurrency: development_environment | |
environment: | |
name: dev | |
url: ${{ env.APPLICATION_URL_DEV }} | |
permissions: | |
id-token: write | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 | |
with: | |
name: webapp | |
- name: Azure log in | |
uses: azure/login@8c334a195cbb38e46038007b304988d888bf676a # v2.0.0 | |
with: | |
client-id: ${{ secrets.AZURE_CLIENT_ID }} | |
tenant-id: ${{ secrets.AZURE_TENANT_ID }} | |
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
- name: Deploy to Azure App Service | |
uses: azure/webapps-deploy@de617f46172a906d0617bb0e50d81e9e3aec24c8 # v3.0.1 | |
with: | |
app-name: ${{ env.AZURE_WEBAPP_NAME }} | |
slot-name: dev | |
test-dev: | |
name: test-dev | |
needs: deploy-dev | |
runs-on: ubuntu-latest | |
concurrency: development_environment | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 | |
- name: Setup .NET SDK | |
uses: actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3 # v4.0.0 | |
- name: Setup NuGet cache | |
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 | |
with: | |
path: ~/.nuget/packages | |
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.props') }} | |
restore-keys: ${{ runner.os }}-nuget- | |
- name: Setup Playwright cache | |
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 | |
with: | |
key: ${{ runner.os }}-playwright-${{ hashFiles('Directory.Packages.props') }} | |
path: | | |
~/AppData/Local/ms-playwright | |
~/.cache/ms-playwright | |
~/Library/Caches/ms-playwright | |
- name: Check application health | |
shell: pwsh | |
env: | |
APPLICATION_URL: ${{ env.APPLICATION_URL_DEV }} | |
run: | | |
$delay = 10 | |
$limit = 10 | |
$success = $false | |
for ($i = 0; $i -lt $limit; $i++) { | |
$response = $null | |
try { | |
$response = Invoke-WebRequest -Uri $env:APPLICATION_URL -Method Get -UseBasicParsing | |
} catch { | |
$response = $_.Exception.Response | |
} | |
if (($null -ne $response) -And ($response.StatusCode -eq 200)) { | |
$success = $true | |
break | |
} | |
Start-Sleep -Seconds $delay | |
} | |
if (-Not $success) { | |
throw "$($env:APPLICATION_URL) did not return a successful status code within the time limit after $limit attempts." | |
} | |
- name: Run end-to-end tests | |
shell: pwsh | |
run: dotnet test ./tests/LondonTravel.Site.Tests --configuration Release --filter Category=EndToEnd --logger "GitHubActions;report-warnings=false" | |
env: | |
WEBSITE_URL: ${{ env.APPLICATION_URL_DEV }} | |
WEBSITE_USER_GOOGLE_USERNAME: ${{ secrets.WEBSITE_USER_GOOGLE_USERNAME }} | |
WEBSITE_USER_GOOGLE_PASSWORD: ${{ secrets.WEBSITE_USER_GOOGLE_PASSWORD }} | |
WEBSITE_USER_MICROSOFT_USERNAME: ${{ secrets.WEBSITE_USER_MICROSOFT_USERNAME }} | |
WEBSITE_USER_MICROSOFT_PASSWORD: ${{ secrets.WEBSITE_USER_MICROSOFT_PASSWORD }} | |
WEBSITE_USER_TWITTER_USERNAME: ${{ secrets.WEBSITE_USER_TWITTER_USERNAME }} | |
WEBSITE_USER_TWITTER_PASSWORD: ${{ secrets.WEBSITE_USER_TWITTER_PASSWORD }} | |
- name: Publish screenshots | |
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 | |
if: ${{ !cancelled() }} | |
with: | |
name: screenshots-e2e-dev | |
path: ./artifacts/screenshots/* | |
if-no-files-found: ignore | |
- name: Publish traces | |
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 | |
if: ${{ !cancelled() }} | |
with: | |
name: traces-e2e-dev | |
path: ./artifacts/traces/* | |
if-no-files-found: ignore | |
- name: Publish videos | |
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 | |
if: ${{ !cancelled() }} | |
with: | |
name: videos-e2e-dev | |
path: ./artifacts/videos/* | |
if-no-files-found: ignore | |
deploy-prod: | |
name: production | |
needs: test-dev | |
runs-on: windows-latest | |
concurrency: production_environment | |
environment: | |
name: production | |
url: ${{ env.APPLICATION_URL_PROD }} | |
permissions: | |
id-token: write | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 | |
with: | |
name: webapp | |
- name: Azure log in | |
uses: azure/login@8c334a195cbb38e46038007b304988d888bf676a # v2.0.0 | |
with: | |
client-id: ${{ secrets.AZURE_CLIENT_ID }} | |
tenant-id: ${{ secrets.AZURE_TENANT_ID }} | |
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
- name: Deploy to Azure App Service | |
uses: azure/webapps-deploy@de617f46172a906d0617bb0e50d81e9e3aec24c8 # v3.0.1 | |
with: | |
app-name: ${{ env.AZURE_WEBAPP_NAME }} | |
test-prod: | |
name: test-prod | |
needs: deploy-prod | |
runs-on: ubuntu-latest | |
concurrency: production_environment | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 | |
- name: Setup .NET SDK | |
uses: actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3 # v4.0.0 | |
- name: Setup NuGet cache | |
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 | |
with: | |
path: ~/.nuget/packages | |
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.props') }} | |
restore-keys: ${{ runner.os }}-nuget- | |
- name: Setup Playwright cache | |
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 | |
with: | |
key: ${{ runner.os }}-playwright-${{ hashFiles('Directory.Packages.props') }} | |
path: | | |
~/AppData/Local/ms-playwright | |
~/.cache/ms-playwright | |
~/Library/Caches/ms-playwright | |
- name: Check application health | |
shell: pwsh | |
env: | |
APPLICATION_URL: ${{ env.APPLICATION_URL_PROD }} | |
run: | | |
$delay = 10 | |
$limit = 10 | |
$success = $false | |
for ($i = 0; $i -lt $limit; $i++) { | |
$response = $null | |
try { | |
$response = Invoke-WebRequest -Uri $env:APPLICATION_URL -Method Get -UseBasicParsing | |
} catch { | |
$response = $_.Exception.Response | |
} | |
if (($null -ne $response) -And ($response.StatusCode -eq 200)) { | |
$success = $true | |
break | |
} | |
Start-Sleep -Seconds $delay | |
} | |
if (-Not $success) { | |
throw "$($env:APPLICATION_URL) did not return a successful status code within the time limit after $limit attempts." | |
} | |
- name: Run end-to-end tests | |
shell: pwsh | |
run: dotnet test ./tests/LondonTravel.Site.Tests --configuration Release --filter Category=EndToEnd --logger "GitHubActions;report-warnings=false" | |
env: | |
WEBSITE_URL: ${{ env.APPLICATION_URL_PROD }} | |
WEBSITE_USER_GOOGLE_USERNAME: ${{ secrets.WEBSITE_USER_GOOGLE_USERNAME }} | |
WEBSITE_USER_GOOGLE_PASSWORD: ${{ secrets.WEBSITE_USER_GOOGLE_PASSWORD }} | |
WEBSITE_USER_MICROSOFT_USERNAME: ${{ secrets.WEBSITE_USER_MICROSOFT_USERNAME }} | |
WEBSITE_USER_MICROSOFT_PASSWORD: ${{ secrets.WEBSITE_USER_MICROSOFT_PASSWORD }} | |
WEBSITE_USER_TWITTER_USERNAME: ${{ secrets.WEBSITE_USER_TWITTER_USERNAME }} | |
WEBSITE_USER_TWITTER_PASSWORD: ${{ secrets.WEBSITE_USER_TWITTER_PASSWORD }} | |
- name: Publish screenshots | |
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 | |
if: ${{ !cancelled() }} | |
with: | |
name: screenshots-e2e-production | |
path: ./artifacts/screenshots/* | |
if-no-files-found: ignore | |
- name: Publish traces | |
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 | |
if: ${{ !cancelled() }} | |
with: | |
name: traces-e2e-production | |
path: ./artifacts/traces/* | |
if-no-files-found: ignore | |
- name: Publish videos | |
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 | |
if: ${{ !cancelled() }} | |
with: | |
name: videos-e2e-production | |
path: ./artifacts/videos/* | |
if-no-files-found: ignore |