Summary
As part of an org-wide effort across Digital Development Team repositories, we need to support Linux builds (ubuntu-latest) instead of windows-latest for CI. The build job in .github/workflows/build.yml currently runs on windows-latest.
Local development is unaffected — this is a CI-only change.
What was found in this repo
- Workflow:
.github/workflows/build.yml — build job has runs-on: windows-latest and a Windows-only Enable long paths for Git step (git config --system core.longpaths true). Unit, Acceptance, and Integration test suites run via PowerShell (pwsh) loops over *.csproj files matching each test-type filter.
- This repo (
NHSDigital.ApiPlatform.Sdk, NHSDigital.ApiPlatform.Sdk.AspNetCore) is a client SDK / broker library for calling the NHS Digital API Platform — it is not backed by a database. A search of the codebase for DbContext/UseSqlServer/UseNpgsql/UseInMemoryDatabase only turns up references inside the .agents/.claude skill templates (shared org coding-standard examples), not in the SDK's own source. No Docker database container is needed for this repo's CI.
- Other workflows:
pages.yml (GitHub Pages, hand-authored per the repo's own dependency-graph documentation) and prLinter.yml are unaffected by this change; add_tag and publish jobs already run on ubuntu-latest.
- Generator: this repo follows the org convention —
.github/workflows/build.yml (and prLinter.yml) are generated by the NHSDigital.ApiPlatform.Infrastructure console project (Program.cs calls ScriptGenerationService.GenerateBuildScript(...), which builds a GithubPipeline via ADotNet and serializes it). The repo's own Documentation/DependencyGraph notes confirm build.yml/prLinter.yml are generated artifacts and must not be hand-edited (pages.yml is the documented exception). build.yml must never be hand-edited directly.
What needs to change
- Runner: In
ScriptGenerationService.GenerateBuildScript (in NHSDigital.ApiPlatform.Infrastructure/Services/ScriptGenerationService.cs), change the build job's RunsOn from BuildMachines.WindowsLatest to BuildMachines.UbuntuLatest.
- Database: Not applicable — this repo has no database dependency, so no Docker database service is required in CI.
- Windows-only step: Remove
Enable long paths for Git (git config --system core.longpaths true) — unnecessary on Ubuntu.
- Test steps: The existing
pwsh-based test loops (Unit/Acceptance/Integration) will continue to work on ubuntu-latest since PowerShell Core is preinstalled there, but verify each step still passes after switching runner OS (e.g. path separators, any Windows-specific assumptions in the test projects).
- Never hand-edit
build.yml: All of the above must be implemented as changes to the C# generator code in NHSDigital.ApiPlatform.Infrastructure, then the console project run to regenerate .github/workflows/build.yml, and the regenerated file committed.
- Verify the regenerated workflow runs green end-to-end on
ubuntu-latest before merging.
Local development
No change — local dev is unaffected by this CI-only migration.
Summary
As part of an org-wide effort across Digital Development Team repositories, we need to support Linux builds (
ubuntu-latest) instead ofwindows-latestfor CI. Thebuildjob in.github/workflows/build.ymlcurrently runs onwindows-latest.Local development is unaffected — this is a CI-only change.
What was found in this repo
.github/workflows/build.yml—buildjob hasruns-on: windows-latestand a Windows-onlyEnable long paths for Gitstep (git config --system core.longpaths true). Unit, Acceptance, and Integration test suites run via PowerShell (pwsh) loops over*.csprojfiles matching each test-type filter.NHSDigital.ApiPlatform.Sdk,NHSDigital.ApiPlatform.Sdk.AspNetCore) is a client SDK / broker library for calling the NHS Digital API Platform — it is not backed by a database. A search of the codebase forDbContext/UseSqlServer/UseNpgsql/UseInMemoryDatabaseonly turns up references inside the.agents/.claudeskill templates (shared org coding-standard examples), not in the SDK's own source. No Docker database container is needed for this repo's CI.pages.yml(GitHub Pages, hand-authored per the repo's own dependency-graph documentation) andprLinter.ymlare unaffected by this change;add_tagandpublishjobs already run onubuntu-latest..github/workflows/build.yml(andprLinter.yml) are generated by theNHSDigital.ApiPlatform.Infrastructureconsole project (Program.cscallsScriptGenerationService.GenerateBuildScript(...), which builds aGithubPipelinevia ADotNet and serializes it). The repo's ownDocumentation/DependencyGraphnotes confirmbuild.yml/prLinter.ymlare generated artifacts and must not be hand-edited (pages.ymlis the documented exception).build.ymlmust never be hand-edited directly.What needs to change
ScriptGenerationService.GenerateBuildScript(inNHSDigital.ApiPlatform.Infrastructure/Services/ScriptGenerationService.cs), change thebuildjob'sRunsOnfromBuildMachines.WindowsLatesttoBuildMachines.UbuntuLatest.Enable long paths for Git(git config --system core.longpaths true) — unnecessary on Ubuntu.pwsh-based test loops (Unit/Acceptance/Integration) will continue to work onubuntu-latestsince PowerShell Core is preinstalled there, but verify each step still passes after switching runner OS (e.g. path separators, any Windows-specific assumptions in the test projects).build.yml: All of the above must be implemented as changes to the C# generator code inNHSDigital.ApiPlatform.Infrastructure, then the console project run to regenerate.github/workflows/build.yml, and the regenerated file committed.ubuntu-latestbefore merging.Local development
No change — local dev is unaffected by this CI-only migration.