mirror of
https://github.com/actions/setup-go.git
synced 2025-09-08 19:23:38 -06:00
Add unit tests
This commit is contained in:
parent
6f72b31c94
commit
deaf43692d
7 changed files with 114 additions and 78 deletions
|
@ -2,6 +2,7 @@ import * as cache from '@actions/cache';
|
|||
import * as core from '@actions/core';
|
||||
import * as exec from '@actions/exec';
|
||||
import {supportedPackageManagers, PackageManagerInfo} from './package-managers';
|
||||
import {isSelfHosted} from './utils';
|
||||
|
||||
export const getCommandOutput = async (toolCommand: string) => {
|
||||
let {stdout, stderr, exitCode} = await exec.getExecOutput(
|
||||
|
@ -83,3 +84,9 @@ export function isCacheFeatureAvailable(): boolean {
|
|||
);
|
||||
return false;
|
||||
}
|
||||
export const getCacheInput = (): boolean => {
|
||||
// for self-hosted environment turn off cache by default
|
||||
if (isSelfHosted() && core.getInput('cache') === '') return false;
|
||||
|
||||
return core.getBooleanInput('cache');
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue