From 86760491537ee894245c373f95e0ed4457e7b45b Mon Sep 17 00:00:00 2001 From: Will Roden Date: Mon, 15 Jan 2024 16:00:26 -0600 Subject: [PATCH] update test and doc --- README.md | 12 ++++++------ action.yml | 6 ++++++ src/run_test_long.sh | 12 ++++++++++++ 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index ba4bd3b..a944e2d 100644 --- a/README.md +++ b/README.md @@ -60,12 +60,6 @@ Setup-go-faster supports these runner systems: | Windows | X64 | windows/amd64 | | Windows | ARM64 | windows/arm64 | -### What\'s missing? - -Just the `stable` input. I don\'t understand what `stable` adds for -actions/setup-go. If you only want stable builds you can set go-version -accordingly. If there is good use case for `stable`, it can be added. - ### A Note About Go 1.21.0 **Use setup-go-faster@v1.9.1 or later** if you want to install Go 1.21.0. @@ -83,6 +77,10 @@ dot-zero releases. They used to be styled like `go1.N`, but now they are The version of go to install. It can be an exact version or a semver constraint like '1.14.x' or '^1.14.4'. Do not add "go" or "v" to the beginning of the version. +There are two aliases available: 'stable' and 'oldstable'. These aliases will be the newest Go release and the +next most recent. For instance when go1.21.6 is the latest release, 'stable' will resolve to '1.21.x' and +'oldstable' will resolve to '1.20.x'. + Action runners come with some versions of go pre-installed. If any of those versions meet your semver constraint setup-go-faster will use those instead of checking whether a newer go available for download that meets your constraint. You can change this with the `ignore-local` input below. @@ -114,6 +112,8 @@ For those who learn best from examples: | ^1.15.4 | installs a go that is >= 1.15.4 and < 2 | | ~1.15.4 | installs a go that is >= 1.15.4 and < 1.16 | | < 1.15.6 >= 1.15.4 | installs a go that is >= 1.15.4 and < 1.15.6 | +| stable | installs the newest go release | +| oldstable | installs the next most recent go release | | tip | installs gotip from source | diff --git a/action.yml b/action.yml index 53c9447..a5dbd37 100644 --- a/action.yml +++ b/action.yml @@ -7,6 +7,10 @@ inputs: The version of go to install. It can be an exact version or a semver constraint like '1.14.x' or '^1.14.4'. Do not add "go" or "v" to the beginning of the version. + There are two aliases available: 'stable' and 'oldstable'. These aliases will be the newest Go release and the + next most recent. For instance when go1.21.6 is the latest release, 'stable' will resolve to '1.21.x' and + 'oldstable' will resolve to '1.20.x'. + Action runners come with some versions of go pre-installed. If any of those versions meet your semver constraint setup-go-faster will use those instead of checking whether a newer go available for download that meets your constraint. You can change this with the `ignore-local` input below. @@ -38,6 +42,8 @@ inputs: | ^1.15.4 | installs a go that is >= 1.15.4 and < 2 | | ~1.15.4 | installs a go that is >= 1.15.4 and < 1.16 | | < 1.15.6 >= 1.15.4 | installs a go that is >= 1.15.4 and < 1.15.6 | + | stable | installs the newest go release | + | oldstable | installs the next most recent go release | | tip | installs gotip from source | go-version-file: diff --git a/src/run_test_long.sh b/src/run_test_long.sh index 5370546..8523023 100755 --- a/src/run_test_long.sh +++ b/src/run_test_long.sh @@ -59,6 +59,18 @@ test_run_1_21rc4() { do_test_run } +test_run_stable() { + GO_VERSION="stable" \ + WANT_VERSION="1.20.7" \ + do_test_run +} + +test_run_oldstable() { + GO_VERSION="oldstable" \ + WANT_VERSION="1.19.12" \ + do_test_run +} + test_go_mod() { GO_VERSION_FILE="$SHUNIT_TMPDIR"/test_go_mod/go.mod mkdir -p -- "$(dirname -- "$GO_VERSION_FILE")"