Add options to skip caching of folders. (#154)
Add option to skip caching the Go package directory (~/go/pkg). Add option to skip caching the Go build directory (~/.cache/go-build). Update README to mention new options.
This commit is contained in:
committed by
GitHub
parent
e1ae6cf354
commit
0dd30832fc
17
dist/run/index.js
vendored
17
dist/run/index.js
vendored
@ -50002,7 +50002,22 @@ const getLintCacheDir = () => {
|
||||
};
|
||||
const getCacheDirs = () => {
|
||||
// Not existing dirs are ok here: it works.
|
||||
return [getLintCacheDir(), path_1.default.resolve(`${process.env.HOME}/.cache/go-build`), path_1.default.resolve(`${process.env.HOME}/go/pkg`)];
|
||||
const skipPkgCache = core.getInput(`skip-pkg-cache`, { required: true }).trim();
|
||||
const skipBuildCache = core.getInput(`skip-build-cache`, { required: true }).trim();
|
||||
const dirs = [getLintCacheDir()];
|
||||
if (skipBuildCache.toLowerCase() == "true") {
|
||||
core.info(`Omitting ~/.cache/go-build from cache directories`);
|
||||
}
|
||||
else {
|
||||
dirs.push(path_1.default.resolve(`${process.env.HOME}/.cache/go-build`));
|
||||
}
|
||||
if (skipPkgCache.toLowerCase() == "true") {
|
||||
core.info(`Omitting ~/go/pkg from cache directories`);
|
||||
}
|
||||
else {
|
||||
dirs.push(path_1.default.resolve(`${process.env.HOME}/go/pkg`));
|
||||
}
|
||||
return dirs;
|
||||
};
|
||||
const getIntervalKey = (invalidationIntervalDays) => {
|
||||
const now = new Date();
|
||||
|
Reference in New Issue
Block a user