Skip to content

Commit

Permalink
Verify documentation images are not stale on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
gunndabad committed Dec 9, 2022
1 parent 42817a5 commit a34140d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@ jobs:
dotnet test test/GovUk.Frontend.AspNetCore.ConformanceTests/ --configuration Release --no-build
dotnet test test/GovUk.Frontend.AspNetCore.IntegrationTests/ --configuration Release --no-build
- name: Check documentation images
run:
DOCS_ROOT=$(realpath docs/images) dotnet run --project src/GovUk.Frontend.AspNetCore.DocSamplesScreenshotter

git diff --cached --quiet docs/images || (
echo "::error ::Documentation images are stale"
exit 1
)

- name: Package
run: dotnet pack src/GovUk.Frontend.AspNetCore/ --configuration Release --no-build
env:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Program
static async Task Main()
{
const string baseUrl = "http://localhost:9919";
const string docsRoot = "../../../../../docs/images/";
string docsRoot = Environment.GetEnvironmentVariable("DOCS_ROOT") ?? "../../../../../docs/images/";

var hostBuilder = CreateHostBuilder();
using var host = hostBuilder.Build();
Expand Down

0 comments on commit a34140d

Please sign in to comment.