Verify documentation images are not stale on CI #1015
Workflow file for this run
This file contains hidden or 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: ci | |
| on: | |
| push: | |
| branches: | |
| - dev | |
| - main | |
| tags: | |
| - v* | |
| paths-ignore: | |
| - docs/** | |
| - LICENSE | |
| - '**.md' | |
| pull_request: | |
| branches: | |
| - dev | |
| - main | |
| - v1.0 | |
| paths-ignore: | |
| - docs/** | |
| - LICENSE | |
| - '**.md' | |
| jobs: | |
| build: | |
| name: "Build & package" | |
| runs-on: ubuntu-latest | |
| env: | |
| DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true | |
| DOTNET_CLI_TELEMETRY_OPTOUT: true | |
| steps: | |
| - uses: actions/checkout@v2 | |
| with: | |
| fetch-depth: 0 | |
| submodules: recursive | |
| - uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: | | |
| 8.0.x | |
| - name: Restore | |
| run: dotnet restore | |
| - name: Format | |
| run: dotnet format --verify-no-changes | |
| - name: Build | |
| run: dotnet build --configuration Release --no-restore | |
| - name: Install Playwright | |
| run: pwsh ./tests/GovUk.Frontend.AspNetCore.IntegrationTests/bin/Release/net8.0/playwright.ps1 install | |
| - name: Check documentation images | |
| run: | |
| dotnet run --project src/GovUk.Frontend.AspNetCore.DocSamplesScreenshotter -c Release | |
| if [ -n "$(git status --porcelain docs/images)" ]; | |
| then | |
| echo "::error ::Documentation images are stale" | |
| exit 1 | |
| fi | |
| - name: Test | |
| run: | | |
| dotnet test tests/GovUk.Frontend.AspNetCore.Tests/ --configuration Release --no-build | |
| dotnet test tests/GovUk.Frontend.AspNetCore.ConformanceTests/ --configuration Release --no-build | |
| dotnet test tests/GovUk.Frontend.AspNetCore.IntegrationTests/ --configuration Release --no-build | |
| - name: Package | |
| run: dotnet pack src/GovUk.Frontend.AspNetCore/ --configuration Release --no-build | |
| env: | |
| MINVERBUILDMETADATA: ${{ env.GITHUB_RUN_NUMBER }} | |
| - name: Publish package artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: GovUk.Frontend.AspNetCore.nupkg | |
| path: src/GovUk.Frontend.AspNetCore/bin/Release/*.nupkg | |
| release: | |
| name: "Release" | |
| runs-on: ubuntu-latest | |
| needs: build | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| steps: | |
| - name: Download package artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: GovUk.Frontend.AspNetCore.nupkg | |
| - name: Publish package to NuGet | |
| run: dotnet nuget push **/*.nupkg --api-key $NUGET_TOKEN --source https://api.nuget.org/v3/index.json --skip-duplicate | |
| env: | |
| NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }} |