Add skip-lts-prepass input to optimize .NET SDK installation process (#791)

- Introduced `skip-lts-prepass` input to allow users to skip the LTS runtime pre-pass during installation.
- Updated documentation to explain the new input and its usage.
- Enhanced tests to verify the behavior of the `skip-lts-prepass` functionality.

Co-authored-by: chiranjib-swain <chiranjib-swain@github.com>
This commit is contained in:
Chiranjib Swain
2026-10-22 03:23:54 +05:30
committed by GitHub
parent e2cf7c663b
commit 349aa191ae
8 changed files with 267 additions and 42 deletions

View File

@@ -315,6 +315,44 @@ describe('setup-dotnet tests', () => {
expect(capturedCheckLatest).toBe(false);
});
it("should read the 'skip-lts-prepass' input and pass it to DotnetCoreInstaller", async () => {
inputs['dotnet-version'] = ['10.0.101'];
inputs['dotnet-quality'] = '';
inputs['architecture'] = '';
inputs['skip-lts-prepass'] = 'true';
let capturedSkipLtsPrepass: boolean | undefined;
installDotnetSpy.mockImplementation(function (this: any) {
capturedSkipLtsPrepass = this.skipLtsPrepass;
return Promise.resolve('');
});
await setup.run();
expect(getBooleanInputSpy).toHaveBeenCalledWith('skip-lts-prepass');
expect(installDotnetSpy).toHaveBeenCalledTimes(1);
expect(capturedSkipLtsPrepass).toBe(true);
});
it("should default 'skip-lts-prepass' to false when the input isn't set", async () => {
inputs['dotnet-version'] = ['10.0.101'];
inputs['dotnet-quality'] = '';
inputs['architecture'] = '';
inputs['skip-lts-prepass'] = '';
let capturedSkipLtsPrepass: boolean | undefined;
installDotnetSpy.mockImplementation(function (this: any) {
capturedSkipLtsPrepass = this.skipLtsPrepass;
return Promise.resolve('');
});
await setup.run();
expect(getBooleanInputSpy).toHaveBeenCalledWith('skip-lts-prepass');
expect(installDotnetSpy).toHaveBeenCalledTimes(1);
expect(capturedSkipLtsPrepass).toBe(false);
});
describe("'check-latest' resolution", () => {
const captureCheckLatest = async () => {
inputs['dotnet-version'] = ['10.0.101'];