Skip to content

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

Merged
merged 27 commits into from
Jun 12, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Respond to review comments
  • Loading branch information
ammario committed Jun 11, 2023
commit 39c1fe5d26975f6fe801e241929c23eb6f745f3a
3 changes: 3 additions & 0 deletions .github/actions/setup-go/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ runs:
${{ env.GOCACHE }}
# Job name must be included in the key for effective
# test cache reuse.
# The key format is intentionally different than GOMODCACHE, because any
# time a Go file changes we invalidate this cache, whereas GOMODCACHE
# is only invalidated when go.sum changes.
key: gocache-${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/*.go', 'go.**') }}
restore-keys: |
gocache-${{ runner.os }}-${{ github.job }}-
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hyphen at the end?

Copy link
Member Author

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.

Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ jobs:

- name: Get golangci-lint cache dir
run: |
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.53.2
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.53.2
dir=$(golangci-lint cache status | awk '/Dir/ { print $2 }')
echo "LINT_CACHE_DIR=$dir" >> $GITHUB_ENV

Expand Down Expand Up @@ -555,6 +555,8 @@ jobs:
- name: Ensure required checks
run: |
echo "Checking required checks"
echo "- fmt: ${{ needs.fmt.result }}"
echo "- lint: ${{ needs.lint.result }}"
echo "- gen: ${{ needs.gen.result }}"
echo "- test-go: ${{ needs.test-go.result }}"
echo "- test-go-pg: ${{ needs.test-go-pg.result }}"
Expand Down
2 changes: 0 additions & 2 deletions enterprise/cli/root_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ import (
"github.com/stretchr/testify/require"

"github.com/coder/coder/cli"

"github.com/coder/coder/cli/clibase"

"github.com/coder/coder/cli/clitest"
)

Expand Down