- Notifications
You must be signed in to change notification settings - Fork907
chore: run test-go-pg on macOS and Windows in regular CI#17853
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Changes fromall commits
fddaf7f
0edcb08
010d50d
6e7cc86
09539ee
2929c79
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: "Setup Go Paths" | ||
description: Overrides Go paths like GOCACHE and GOMODCACHE to use temporary directories. | ||
outputs: | ||
gocache: | ||
description: "Value of GOCACHE" | ||
value: ${{ steps.paths.outputs.gocache }} | ||
gomodcache: | ||
description: "Value of GOMODCACHE" | ||
value: ${{ steps.paths.outputs.gomodcache }} | ||
gopath: | ||
description: "Value of GOPATH" | ||
value: ${{ steps.paths.outputs.gopath }} | ||
gotmp: | ||
description: "Value of GOTMPDIR" | ||
value: ${{ steps.paths.outputs.gotmp }} | ||
cached-dirs: | ||
description: "Go directories that should be cached between CI runs" | ||
value: ${{ steps.paths.outputs.cached-dirs }} | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Override Go paths | ||
id: paths | ||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7 | ||
with: | ||
script: | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I don't mind using the script here, but you can accomplish the same with bash by echoing to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I chose to use the script to handle setting multi-line env variables. With bash, you have to be very careful with whitespace and indentation. It's error-prone. | ||
const path = require('path'); | ||
// RUNNER_TEMP should be backed by a RAM disk on Windows if | ||
// coder/setup-ramdisk-action was used | ||
const runnerTemp = process.env.RUNNER_TEMP; | ||
const gocacheDir = path.join(runnerTemp, 'go-cache'); | ||
const gomodcacheDir = path.join(runnerTemp, 'go-mod-cache'); | ||
const gopathDir = path.join(runnerTemp, 'go-path'); | ||
const gotmpDir = path.join(runnerTemp, 'go-tmp'); | ||
core.exportVariable('GOCACHE', gocacheDir); | ||
core.exportVariable('GOMODCACHE', gomodcacheDir); | ||
core.exportVariable('GOPATH', gopathDir); | ||
core.exportVariable('GOTMPDIR', gotmpDir); | ||
core.setOutput('gocache', gocacheDir); | ||
core.setOutput('gomodcache', gomodcacheDir); | ||
core.setOutput('gopath', gopathDir); | ||
core.setOutput('gotmp', gotmpDir); | ||
const cachedDirs = `${gocacheDir}\n${gomodcacheDir}`; | ||
core.setOutput('cached-dirs', cachedDirs); | ||
- name: Create directories | ||
shell: bash | ||
run: | | ||
set -e | ||
mkdir -p "$GOCACHE" | ||
mkdir -p "$GOMODCACHE" | ||
mkdir -p "$GOPATH" | ||
mkdir -p "$GOTMPDIR" |
This file was deleted.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.