Skip to content

Commit

Permalink
log to posix
Browse files Browse the repository at this point in the history
  • Loading branch information
p0deje committed May 31, 2024
1 parent d683b61 commit a36fde6
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 8 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,14 @@ jobs:
- ubuntu
- windows
steps:
- run: rm $(which bazel)
- uses: actions/checkout@v4
- uses: ./
with:
bazelisk-cache: true
bazelisk-version: 1.x
remote-cache: true
repository-cache: true
- uses: actions/checkout@v4
with:
repository: bazelbuild/examples
Expand Down
5 changes: 3 additions & 2 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,11 @@ if (diskCacheEnabled) {
}
}

const remoteCacheLogPath = core.toPosixPath(`${os.tmpdir()}/remote-cache-server.log`)
const remoteCacheServerUrl = 'http://localhost:9889/cache'
const remoteCacheEnabled = core.getBooleanInput('remote-cache')
if (remoteCacheEnabled) {
bazelrc.push(`build --remote_cache=${remoteCacheServerUrl}\n`)
bazelrc.push(`build --remote_cache=${remoteCacheServerUrl}`)
if (diskCacheEnabled) {
core.error('Disk cache and remote cache cannot be enabled at the same time')
}
Expand Down Expand Up @@ -162,7 +163,7 @@ module.exports = {
},
remoteCache: {
enabled: remoteCacheEnabled,
logPath: `${os.tmpdir()}/remote-cache-server.log`,
logPath: remoteCacheLogPath,
url: remoteCacheServerUrl,
}
}
5 changes: 3 additions & 2 deletions dist/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,11 @@ if (diskCacheEnabled) {
}
}

const remoteCacheLogPath = core.toPosixPath(`${os.tmpdir()}/remote-cache-server.log`)
const remoteCacheServerUrl = 'http://localhost:9889/cache'
const remoteCacheEnabled = core.getBooleanInput('remote-cache')
if (remoteCacheEnabled) {
bazelrc.push(`build --remote_cache=${remoteCacheServerUrl}\n`)
bazelrc.push(`build --remote_cache=${remoteCacheServerUrl}`)
if (diskCacheEnabled) {
core.error('Disk cache and remote cache cannot be enabled at the same time')
}
Expand Down Expand Up @@ -168,7 +169,7 @@ module.exports = {
},
remoteCache: {
enabled: remoteCacheEnabled,
logPath: `${os.tmpdir()}/remote-cache-server.log`,
logPath: remoteCacheLogPath,
url: remoteCacheServerUrl,
}
}
Expand Down
2 changes: 1 addition & 1 deletion dist/main/index.js.map

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions dist/post/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,11 @@ if (diskCacheEnabled) {
}
}

const remoteCacheLogPath = core.toPosixPath(`${os.tmpdir()}/remote-cache-server.log`)
const remoteCacheServerUrl = 'http://localhost:9889/cache'
const remoteCacheEnabled = core.getBooleanInput('remote-cache')
if (remoteCacheEnabled) {
bazelrc.push(`build --remote_cache=${remoteCacheServerUrl}\n`)
bazelrc.push(`build --remote_cache=${remoteCacheServerUrl}`)
if (diskCacheEnabled) {
core.error('Disk cache and remote cache cannot be enabled at the same time')
}
Expand Down Expand Up @@ -168,7 +169,7 @@ module.exports = {
},
remoteCache: {
enabled: remoteCacheEnabled,
logPath: `${os.tmpdir()}/remote-cache-server.log`,
logPath: remoteCacheLogPath,
url: remoteCacheServerUrl,
}
}
Expand Down
2 changes: 1 addition & 1 deletion dist/post/index.js.map

Large diffs are not rendered by default.

0 comments on commit a36fde6

Please sign in to comment.