Commit Graph

86 Commits (763ffebccec53ce64511bae4656a00972ceb3da6)

Author SHA1 Message Date
Matthew Hughes 763ffebcce Configure environment to avoid toolchain installs
Force `go` to always use the local toolchain (i.e. the one the one that
shipped with the go command being run) via setting the `GOTOOLCHAIN`
environment variable to `local`[1]:

> When GOTOOLCHAIN is set to local, the go command always runs the
bundled Go toolchain.

This is how things are setup in the official Docker images (e.g.[2], see
also the discussion around that change[3]). The motivation behind this
is to:

* Reduce duplicate work, the action will install a version of Go, a
  toolchain will be detected, the toolchain will be detected and then
  another version of Go installed
* Avoid Unexpected behaviour: if you specify this action runs with some Go
  version (e.g. `1.21.0`) but your go.mod contains a `toolchain` or `go`
  directive for a newer version (e.g. `1.22.0`) then, without any other
  configuration/environment setup, any go commands will be run using go
  `1.22.0`
* TODO: link image

This will be a **breaking change** for some workflows. Given a `go.mod`
like:

    module proj

    go 1.22.0

Then running any `go` command, e.g. `go mod tidy`, in an environment
where only go versions before `1.22.0` were installed would previously
trigger a toolchain download of Go `1.22.0` and that version being used
to execute the command. With this change the above would error out with
something like:

> go: go.mod requires go >= 1.22.0 (running go 1.21.7;
GOTOOLCHAIN=local)

[1] https://go.dev/doc/toolchain#select
[2] dae3405a32/Dockerfile-linux.template (L163)
[3] https://github.com/docker-library/golang/issues/472
3 months ago
Zxilly b26d40294f
fix: add arch to cache key (#493) 5 months ago
dependabot[bot] 0a12ed9d6a
Bump braces from 3.0.2 to 3.0.3 (#487)
* Bump braces from 3.0.2 to 3.0.3

Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3.
- [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/braces/compare/3.0.2...3.0.3)

---
updated-dependencies:
- dependency-name: braces
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump undici from 5.28.3 to 5.28.4

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: HarithaVattikuti <73516759+HarithaVattikuti@users.noreply.github.com>
7 months ago
dependabot[bot] be1aa1186e
Bump undici from 5.28.2 to 5.28.3 (#465)
* Bump undici from 5.28.2 to 5.28.3

Bumps [undici](https://github.com/nodejs/undici) from 5.28.2 to 5.28.3.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v5.28.2...v5.28.3)

---
updated-dependencies:
- dependency-name: undici
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* fixed check failures and update dependencies

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: HarithaVattikuti <73516759+HarithaVattikuti@users.noreply.github.com>
10 months ago
Dmitry Shibanov 0c52d547c9
Update dependencies for node20 (#445) 1 year ago
Piotr Galar 89a192af9d fix: sync .complete marker when caching tools on windows 1 year ago
Sergey Dolin 93397bea11
Fix Install on Windows is very slow (#393)
* Fix Install on Windows is very slow

* Add unit test

* Improve readability

* Add e2e test

* fix lint

* Fix unit tests

* Fix unit tests

* limit to github hosted runners

* test hosted version of go

* AzDev environment

* rename lnkSrc

* refactor conditions

* improve tests

* refactoring

* Fix e2e test

* improve isHosted readability
1 year ago
Dusan Trickovic 0bb97b1c5c Rebuild after updating Semver 2 years ago
Sergey Dolin 4e0b6c77c6 Limit to Linux only 2 years ago
Sergey Dolin a4d10f0ea4 Add imageOS to primaryKey
https://github.com/actions/setup-go/issues/368
2 years ago
Nikolai Laevskii fac708d667
Bump @actions/cache dependency to v3.2.1 (#374) 2 years ago
Dmitry Shibanov dd84a9531a
Update xml2js (#370) 2 years ago
Dmitry Shibanov fdc0d672a1
Add Go bin if go-version input is empty (#351) 2 years ago
Dmitry Shibanov ebfdf6ac95
add warning if go-version is empty (#350) 2 years ago
Sergey Dolin c51a720768
Enable caching by default with default input (#332) 2 years ago
Ivan 7406d654ad
Add and configure ESLint and update configuration for Prettier (#341)
* Turn on ESLint and update Prettier

* Update eslint config

* Update eslint config

* Update dependencies

* Update ESLint and Prettier configurations

* update package.json

* Update prettier command

* Update prettier config file

* Change CRLF to LF

* Update docs

* Update docs
2 years ago
Evgenii Korolevskii b8eec33327 Merge branch 'main' into use-actual-version-in-cache 2 years ago
Serghei Iakovlev 807559307d
Use const declarations for variables that are never reassigned (#322) 2 years ago
Evgenii Korolevskii 65f50caf42 use actual version in key 2 years ago
Evgenii Korolevskii 89d7939d38 use real version instead of spec 2 years ago
Evgenii Korolevskii 2e7414f276 try get path 2 years ago
Evgenii Korolevskii de201a09c0 log version-spec 2 years ago
Evgenii Korolevskii 17106403fa
Allow to use only GOCACHE for cache (#305) 2 years ago
Jongwoo Han bb5ff97ab9
refactor: Use early return pattern to avoid nested conditions (#302) 2 years ago
Dmitry Shibanov 6edd4406fa
fix log for stable aliases (#303) 2 years ago
Milos Pantic 38dbe75f81
Add stable and oldstable aliases (#300) 2 years ago
Marko Zivic e983b65a44
Merge pull request #283 from koba1t/add_support_gowork_for_go-version-file
add support go.work file for go-version-file
2 years ago
Dmitry Shibanov 27b43e1b0d
Pass the token input through on GHES (#277) 2 years ago
koba1t 7678c83214
add support gowork for go-version-file 2 years ago
n33pm c4a742cab1
fix(): cache resolve version input (#267) 2 years ago
Francesco Renzi 514ae57904 Update @actions/core to 1.10.0 2 years ago
Evgenii Korolevskii c4e169859f prettier format 2 years ago
Evgenii Korolevskii db58e98a43 format 2 years ago
Evgenii Korolevskii 2905db4069 update build 2 years ago
Evgenii Korolevskii be45b2722d build 2 years ago
Milos Pantic 268d8c0ca0
Add support for arm32 go arch (#253) 2 years ago
Javier Romero e0dce94eb0 Use explicit filename when downloading Windows go package
Using the explicit filename for Windows is necessary to
satisfy `Expand-Archive`'s requirement on '.zip' extension.

Signed-off-by: Javier Romero <root@jromero.codes>
2 years ago
Vladimir Safonkin dd64cc9b01 Build dist 3 years ago
Vladimir Safonkin ed8da5df39 Build js 3 years ago
Vladimir Safonkin 6036aa2424 Add cache error handling 3 years ago
IvanZosimov b22fbbc292
Implementation of caching functionality for setup-go action (#228) 3 years ago
Dmitry Shibanov fcdc43634a
Update @zeit/ncc to @vercel/ncc (#229) 3 years ago
So Jomura 265edc1beb
Add go-version-file option (#62) 3 years ago
Brian Cristante 193b404f8a
Successfully set up (#231) 3 years ago
Vladimir Safonkin ad70bef2ef Fix condition for old go versions 3 years ago
Nick 4a4352b330
Add 'go-version' Output (#85)
* Add go-version to action outputs

This provides the semver version of Go that has been installed. This is useful
if only a major or minor version has been provided as the input go-version
value.

* Convert version extraction to a function

Simplify how the version is extracted and add a simple test at the same
time.

Co-authored-by: Peter Mescalchin <peter@magnetikonline.com>
Co-authored-by: Brian Cristante <33549821+brcrista@users.noreply.github.com>

Co-authored-by: Peter Mescalchin <peter@magnetikonline.com>
Co-authored-by: Brian Cristante <33549821+brcrista@users.noreply.github.com>
3 years ago
Fraser Waters 13df686579 Update dist 3 years ago
Josh Gross 229eefa42b
Update `dist` 3 years ago
Josh Gross 2a34c33bd7
Export `GOROOT` for versions < 1.9 3 years ago
Manuel Mendez 83124a14b6 Do not export GOROOT
This has not been necessary since [Go 1.9](https://go.dev/doc/go1.9#goroot) at
least (although clunky to do so then) but definitely not since
[Go 1.10](https://go.dev/doc/go1.10#goroot).

This is cargo culting code that is more than 2 years out of date and runs into
issues when multiple go versions are used in an action run.

Signed-off-by: Manuel Mendez <mmendez534@gmail.com>
3 years ago