Support Caching in Mono Repo (#629)
This commit is contained in:
9
dist/post_run/index.js
vendored
9
dist/post_run/index.js
vendored
@ -67482,9 +67482,14 @@ function buildCacheKeys() {
|
||||
// TODO: configure it via inputs.
|
||||
let cacheKey = `golangci-lint.cache-${getIntervalKey(7)}-`;
|
||||
keys.push(cacheKey);
|
||||
if (yield pathExists(`go.mod`)) {
|
||||
// Get working directory from input
|
||||
const workingDirectory = core.getInput(`working-directory`);
|
||||
// create path to go.mod prepending the workingDirectory if it exists
|
||||
const goModPath = path_1.default.join(workingDirectory, `go.mod`);
|
||||
core.info(`Checking for go.mod: ${goModPath}`);
|
||||
if (yield pathExists(goModPath)) {
|
||||
// Add checksum to key to invalidate a cache when dependencies change.
|
||||
cacheKey += yield checksumFile(`sha1`, `go.mod`);
|
||||
cacheKey += yield checksumFile(`sha1`, goModPath);
|
||||
}
|
||||
else {
|
||||
cacheKey += `nogomod`;
|
||||
|
9
dist/run/index.js
vendored
9
dist/run/index.js
vendored
@ -67482,9 +67482,14 @@ function buildCacheKeys() {
|
||||
// TODO: configure it via inputs.
|
||||
let cacheKey = `golangci-lint.cache-${getIntervalKey(7)}-`;
|
||||
keys.push(cacheKey);
|
||||
if (yield pathExists(`go.mod`)) {
|
||||
// Get working directory from input
|
||||
const workingDirectory = core.getInput(`working-directory`);
|
||||
// create path to go.mod prepending the workingDirectory if it exists
|
||||
const goModPath = path_1.default.join(workingDirectory, `go.mod`);
|
||||
core.info(`Checking for go.mod: ${goModPath}`);
|
||||
if (yield pathExists(goModPath)) {
|
||||
// Add checksum to key to invalidate a cache when dependencies change.
|
||||
cacheKey += yield checksumFile(`sha1`, `go.mod`);
|
||||
cacheKey += yield checksumFile(`sha1`, goModPath);
|
||||
}
|
||||
else {
|
||||
cacheKey += `nogomod`;
|
||||
|
Reference in New Issue
Block a user