mirror of
https://github.com/actions/setup-go.git
synced 2025-05-04 14:14:34 +00:00
Add 'go-version' Output (#85)
* Add go-version to action outputs This provides the semver version of Go that has been installed. This is useful if only a major or minor version has been provided as the input go-version value. * Convert version extraction to a function Simplify how the version is extracted and add a simple test at the same time. Co-authored-by: Peter Mescalchin <peter@magnetikonline.com> Co-authored-by: Brian Cristante <33549821+brcrista@users.noreply.github.com> Co-authored-by: Peter Mescalchin <peter@magnetikonline.com> Co-authored-by: Brian Cristante <33549821+brcrista@users.noreply.github.com>
This commit is contained in:
@ -105,6 +105,11 @@ describe('setup-go', () => {
|
||||
jest.restoreAllMocks();
|
||||
}, 100000);
|
||||
|
||||
it('can extract the major.minor.patch version from a given Go version string', async () => {
|
||||
const goVersionOutput = 'go version go1.16.6 darwin/amd64';
|
||||
expect(main.parseGoVersion(goVersionOutput)).toBe('1.16.6');
|
||||
});
|
||||
|
||||
it('can find 1.9.7 from manifest on osx', async () => {
|
||||
os.platform = 'darwin';
|
||||
os.arch = 'x64';
|
||||
|
Reference in New Issue
Block a user