This commit is contained in:
Alex Rodionov 2024-05-30 20:40:48 -07:00
parent 319902179c
commit 729d401ac3
12 changed files with 77 additions and 32 deletions

19
dist/post/index.js vendored
View file

@ -52,6 +52,15 @@ if (diskCacheEnabled) {
}
}
const remoteCacheServerUrl = 'http://localhost:9889/cache'
const remoteCacheEnabled = core.getBooleanInput('remote-cache')
if (remoteCacheEnabled) {
bazelrc.push(`build --remote_cache=${remoteCacheServerUrl}\n`)
if (diskCacheEnabled) {
core.error('Disk cache and remote cache cannot be enabled at the same time')
}
}
const repositoryCacheConfig = core.getInput('repository-cache')
const repositoryCacheEnabled = repositoryCacheConfig !== 'false'
let repositoryCacheFiles = [
@ -157,10 +166,10 @@ module.exports = {
name: 'repository',
paths: [bazelRepository]
},
remoteCacheServer: {
enabled: true,
url: 'http://localhost:8080/cache',
remoteCache: {
enabled: remoteCacheEnabled,
logPath: `${os.tmpdir()}/remote-cache-server.log`,
url: remoteCacheServerUrl,
}
}
@ -95947,7 +95956,9 @@ async function run() {
}
async function stopRemoteCacheServer() {
core.info(fs.readFileSync(config.remoteCacheServer.logPath, 'utf8'))
if (!config.remoteCacheServer.enabled) {
return
}
const pid = core.getState('remote-cache-server-pid')
if (pid) {