-
Notifications
You must be signed in to change notification settings - Fork 890
ci: improve Go caching #7954
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: improve Go caching #7954
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is no longer a hotfix.
- ✅ Base is main
- ✅ Has hotfix label
- ✅ Head is from coder/coder
- ❌ Less than 100 lines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Setup Go workflow needs to work on Windows
- name: Get cache dirs | ||
shell: bash | ||
run: | | ||
set -x | ||
echo "GOMODCACHE=$(go env GOMODCACHE)" >> $GITHUB_ENV | ||
echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't work on Windows runners
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh?
${{ env.GOMODCACHE }} | ||
key: gomodcache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}-${{ github.job }} | ||
restore-keys: | | ||
gomodcache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GOCACHE also has the github.job one listed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a comment that may help this make more sense
go-${{ runner.os }}-${{ github.job }}- | ||
go-${{ runner.os }}- | ||
go- | ||
gocache-${{ runner.os }}-${{ github.job }}- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hyphen at the end?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was on purpose. It's how I've seen it done on a few docs. I guess it clearly symbolizes the end of a token.
repo: gotestyourself/gotestsum | ||
tag: v1.9.0 | ||
shell: bash | ||
run: go install gotest.tools/gotestsum@latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does not work on Windows AFAIK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why?
lint/go: | ||
./scripts/check_enterprise_imports.sh | ||
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.53.2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be skipped if golangci-lint is in PATH?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do it though? It runs almost instantly if already installed.
@deansheather the windows job seems to run fine? |
Force merging as folks are struggling with CI today. |
... Amongst various other minor improvements.