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

Avoid Toolchain download before cache download #456

Commits on Feb 8, 2024

  1. Avoid Toolchain download before cache download

    `go version` is run before downloading the cache, but if this is run
    with a version of `go` that triggers a Toolchain download[1], e.g. if
    the installed Go is 1.20.0 but `go.mod` has a toolchain directive
    `go1.20.1` then a toolchain is downloaded to e.g.
    `$GOMODCACHE/golang.org/toolchain@v0.0.1-go1.21.1.linux-amd64`, if this
    file already exists in the cache (e.g. this is the second run of this
    action we not cache invalidation) then the cache download will try and
    overwrite these files resulting in noisy errors like:
    
        /usr/bin/tar: ../../../go/pkg/mod/golang.org/toolchain@v0.0.1-go1.21.6.linux-amd64/lib/time/mkzip.go: Cannot open: File exists
    
    Instead, force `go` to use the local toolchain (i.e. the one the one
    that shipped with the go command being run) via setting the
    `GOTOOLCHAIN` environment variable[1]:
    
    > When GOTOOLCHAIN is set to local, the go command always runs the
    bundled Go toolchain.
    
    This addresses actions#424
    
    [1] https://go.dev/doc/toolchain#select
    matthewhughes934 committed Feb 8, 2024
    Configuration menu
    Copy the full SHA
    0815ecb View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c183053 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a02bf28 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    6a7d247 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    ebf5061 View commit details
    Browse the repository at this point in the history
  6. squash! Avoid Toolchain download before cache download

    Also handle lookups on cache restore
    matthewhughes934 committed Feb 8, 2024
    Configuration menu
    Copy the full SHA
    fc872ec View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    96dc292 View commit details
    Browse the repository at this point in the history