Skip to content
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

Merged
merged 14 commits into from
May 18, 2023

Conversation

artemgavrilov
Copy link
Contributor

@artemgavrilov artemgavrilov commented May 16, 2023

PMM-7

This PR:

  1. Fixes problem with caches overlapping
  2. Removes go tip weekly builds
  3. Adds missing go build caches
  4. Adds verbosity to modules downloading
  5. Fetches go runtime version from go.mod file

@codecov
Copy link

codecov bot commented May 16, 2023

Codecov Report

Merging #2137 (e0756e0) into main (6c730b3) will decrease coverage by 0.04%.
The diff coverage is n/a.

@@            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     
Flag Coverage Δ
admin 10.46% <ø> (ø)
agent 52.90% <ø> (-0.16%) ⬇️
managed 43.71% <ø> (ø)
vmproxy 70.58% <ø> (ø)

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
Copy link
Contributor Author

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

Copy link
Member

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!

Copy link
Member

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
Copy link
Contributor Author

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
Copy link
Contributor Author

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
Copy link
Contributor Author

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') }}
Copy link
Contributor Author

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

@artemgavrilov artemgavrilov marked this pull request as ready for review May 17, 2023 09:52
@artemgavrilov artemgavrilov requested review from a team as code owners May 17, 2023 09:52
@artemgavrilov artemgavrilov requested review from BupycHuk, ademidoff, JiriCtvrtka, idoqo and PavelKhripkov and removed request for a team May 17, 2023 09:52
@artemgavrilov artemgavrilov enabled auto-merge (squash) May 18, 2023 14:08
@ademidoff ademidoff disabled auto-merge May 18, 2023 16:17
@ademidoff ademidoff enabled auto-merge (squash) May 18, 2023 16:17
@ademidoff ademidoff disabled auto-merge May 18, 2023 16:18
@ademidoff ademidoff merged commit e9681fe into main May 18, 2023
29 of 32 checks passed
@ademidoff ademidoff deleted the PMM-7-fix-ci-caches branch May 18, 2023 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants