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 <[email protected]> Co-authored-by: Brian Cristante <[email protected]> Co-authored-by: Peter Mescalchin <[email protected]> Co-authored-by: Brian Cristante <[email protected]>
This commit is contained in:
co-authored by
Peter Mescalchin
Brian Cristante
parent
115d6e6004
commit
4a4352b330
@@ -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