-
Notifications
You must be signed in to change notification settings - Fork 138
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
PMM-7 Remove go tip runs, use go version for CI from go.mod file #2137
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2137 +/- ##
==========================================
- Coverage 42.62% 42.59% -0.04%
==========================================
Files 387 387
Lines 47651 47651
==========================================
- Hits 20313 20298 -15
- Misses 25431 25445 +14
- Partials 1907 1908 +1
Flags with carried forward coverage won't be shown. Click here to find out more. see 1 file with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
go-version-file: ${{ github.workspace }}/go.mod |
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.
Fetches go version directly from go.mod file
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's a great choice!
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.
Super
|
||
- name: Download Go modules | ||
run: go mod download | ||
run: go mod download -x |
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.
Enables verbose mode (i.e. it will print what it downloads)
./make.bash | ||
echo "GOROOT=$HOME/gotip" >> $GITHUB_ENV | ||
echo "$HOME/gotip/bin" >> $GITHUB_PATH | ||
- name: Enable Go build cache |
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.
Build cache saves almost two minutes in this workflow
@@ -98,7 +84,7 @@ jobs: | |||
uses: reviewdog/action-golangci-lint@v2 | |||
with: | |||
github_token: ${{ secrets.ROBOT_TOKEN || secrets.GITHUB_TOKEN }} | |||
go_version: ${{ env.GO_VERSION }} | |||
go_version_file: ${{ github.workspace }}/go.mod |
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.
Similar to setup-go
. Reviewdog will fetch go version from go.mod file.
key: ${{ runner.os }}-go-${{ env.GO_VERSION }}-modules-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go-${{ env.GO_VERSION }}-modules- | ||
key: ${{ runner.os }}-go-modules-${{ 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.
This is why we can't use embedded in setup-go
action cache. Our cache uses all go.mod
files in the project, while setup-go can use only one file. However this feature may be implemented soon: actions/setup-go#371
PMM-7
This PR: