mirror of
https://github.com/actions/setup-dotnet.git
synced 2025-12-16 14:39:44 +00:00
improve docs
This commit is contained in:
parent
bbe37706ae
commit
d41b67df8d
@ -50,9 +50,9 @@ steps:
|
||||
- run: dotnet build <my project>
|
||||
```
|
||||
|
||||
## Installing Runtimes for Multi-Targeting
|
||||
## Installing additional runtimes
|
||||
|
||||
The `dotnet-runtime` input allows you to install .NET runtimes separately from SDKs. This is useful for multi-targeting scenarios where you need one SDK version but multiple runtime versions for testing.
|
||||
The `dotnet-runtime` input allows you to install .NET runtimes separately from SDKs. This is useful for multi-targeting scenarios where you need one SDK version but multiple runtime versions.
|
||||
|
||||
When `dotnet-runtime` is specified, both the .NET Runtime (Microsoft.NETCore.App) and the ASP.NET Core Runtime (Microsoft.AspNetCore.App) are installed for each specified version.
|
||||
|
||||
|
||||
@ -508,70 +508,6 @@ describe('installer tests', () => {
|
||||
).join(' ');
|
||||
expect(aspnetcoreScriptArguments).toContain(expectedArgument);
|
||||
});
|
||||
|
||||
it(`should warn if the 'quality' input is set and the supplied version is in A.B.C syntax`, async () => {
|
||||
const inputVersion = '8.0.402';
|
||||
const inputQuality = 'ga' as QualityOptions;
|
||||
const stdout = `Fictitious dotnet runtime version ${inputVersion} is installed`;
|
||||
getExecOutputSpy.mockImplementation(() => {
|
||||
return Promise.resolve({
|
||||
exitCode: 0,
|
||||
stdout: `${stdout}`,
|
||||
stderr: ''
|
||||
});
|
||||
});
|
||||
maxSatisfyingSpy.mockImplementation(() => inputVersion);
|
||||
|
||||
const dotnetInstaller = new installer.DotnetCoreInstaller(
|
||||
inputVersion,
|
||||
inputQuality
|
||||
);
|
||||
|
||||
await dotnetInstaller.installRuntime();
|
||||
|
||||
expect(warningSpy).toHaveBeenCalledWith(
|
||||
`The 'dotnet-quality' input can be used only with .NET SDK version in A.B, A.B.x, A, A.x and A.B.Cxx formats where the major tag is higher than 5. You specified: ${inputVersion}. 'dotnet-quality' input is ignored.`
|
||||
);
|
||||
});
|
||||
|
||||
each(['8', '8.0', '8.0.x', '8.0.*', '8.0.X']).test(
|
||||
`should supply 'quality' argument to both runtime installation scripts if quality input is set and version (%s) is not in A.B.C syntax`,
|
||||
async inputVersion => {
|
||||
const inputQuality = 'ga' as QualityOptions;
|
||||
const exitCode = 0;
|
||||
const stdout = `Fictitious dotnet runtime version 8.0.0 is installed`;
|
||||
getExecOutputSpy.mockImplementation(() => {
|
||||
return Promise.resolve({
|
||||
exitCode: exitCode,
|
||||
stdout: `${stdout}`,
|
||||
stderr: ''
|
||||
});
|
||||
});
|
||||
maxSatisfyingSpy.mockImplementation(() => inputVersion);
|
||||
|
||||
const dotnetInstaller = new installer.DotnetCoreInstaller(
|
||||
inputVersion,
|
||||
inputQuality
|
||||
);
|
||||
|
||||
await dotnetInstaller.installRuntime();
|
||||
|
||||
const expectedArgument = IS_WINDOWS
|
||||
? `-Quality ${inputQuality}`
|
||||
: `--quality ${inputQuality}`;
|
||||
|
||||
// Check both calls contain quality argument
|
||||
const dotnetScriptArguments = (
|
||||
getExecOutputSpy.mock.calls[0][1] as string[]
|
||||
).join(' ');
|
||||
expect(dotnetScriptArguments).toContain(expectedArgument);
|
||||
|
||||
const aspnetcoreScriptArguments = (
|
||||
getExecOutputSpy.mock.calls[1][1] as string[]
|
||||
).join(' ');
|
||||
expect(aspnetcoreScriptArguments).toContain(expectedArgument);
|
||||
}
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user