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

Use setup-go action to cache dependencies #6220

Merged
merged 1 commit into from
Oct 7, 2022
Merged

Use setup-go action to cache dependencies #6220

merged 1 commit into from
Oct 7, 2022

Conversation

jongwooo
Copy link
Contributor

@jongwooo jongwooo commented Oct 6, 2022

Signed-off-by: jongwooo [email protected]

Description

I changed the workflow to cache dependencies using actions/setup-go. actions/setup-go@v3 or newer has caching built-in.

AS-IS

- name: Install Go
  uses: actions/setup-go@v2
  with:
    go-version: '1.19.1'
- name: Checkout
  uses: actions/checkout@v2
  with:
    fetch-depth: 1

TO-BE

- name: Checkout
  uses: actions/checkout@v3
  with:
    fetch-depth: 1
- name: Install Go
  uses: actions/setup-go@v3
  with:
    go-version: '1.19.1'
    check-latest: true
    cache: true
    cache-dependency-path: |
          **/go.sum
          **/go.mod

References

@jongwooo jongwooo requested a review from a team as a code owner October 6, 2022 17:54
Copy link
Member

@brandond brandond left a comment

Choose a reason for hiding this comment

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

This looks good although I'm not sure exactly where the speedup is supposed to be visible?

Copy link
Member

@dereknola dereknola left a comment

Choose a reason for hiding this comment

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

@brandond It should cache the ginkgo and gomega packages, since those are downloaded when running go test. But your correct in that I don't expect must speed up. We aren't caching any of the k3s build dependencies, we don't built K3s in these jobs.

@dereknola dereknola merged commit 934d013 into k3s-io:master Oct 7, 2022
@jongwooo jongwooo deleted the chore/use-setup-go-action-to-cache-dependencies branch October 8, 2022 00:27
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.

3 participants