GitHub Actions:
- Fix skipping of test coverage on old Go; GitHub Actions doesn't have true
booleans (https://github.com/actions/runner/issues/1483)
- Update workflow versions.
Cirrus:
- Download Go toolchain from go.dev on all BSD platforms.
Both:
- Bump Go to 1.22 (with one GitHub Actions job still running Go 1.21).
- Fix the cache key used in check_website.yml. It was blindly copied from ci.yml
and contained matrix parameters that are not present in this workflow.
- Simplify the derivation of OS_TYPE used for tagging coverages to use a ternary
expression.
- Simplify the condition for uploading coverages by introducing a new "old-go"
matrix parameter.
While working on an unrelated change I noticed that `make all-checks`
found a typo. I was using codespell 2.2.5 so this also upodates the
.github/workflows/ci.yml file to depend on that release since doing so
does not introduce any false positives.
- Consolidate all checks into a "all-checks" target in the Makefile, and use it
from tools/pre-push and ci.yml.
- Remove trivial make targets, including "generate" and all the individual check
targets.
- Remove the trivial script tools/lint.sh.
- Rename the "checkstyle" scripts to "check-fmt", which is more specific.
While working on a change to augment `make lint` to be more comprehensive I
noticed that `go generate ./...` produced unexpected errors on my system (see
below). This augments the CI environment checks to verify that the generated
code is up to date. This also augments the pre-push script to perform the
checks by the tools/check-content script run by the CI environment.
FWIW: The errors shown below were because my version of the
`stringer` tool was out of date (fixed by running `go install
golang.org/x/tools/stringer@latest`) Regardless, the point of this change
is that the pre-push script and the CI environment should verify that the
generated code is up to date. This change adds those checks.
> go generate ./...
stringer: internal error: package "fmt" without types was imported from
"src.elv.sh/pkg/getopt"
pkg/getopt/getopt.go:11: running "stringer": exit status 1
stringer: internal error: package "fmt" without types was imported from
"src.elv.sh/pkg/md"
pkg/md/md.go:163: running "stringer": exit status 1
stringer: internal error: package "fmt" without types was imported from
"src.elv.sh/pkg/parse"
pkg/parse/parse.go:11: running "stringer": exit status 1
Exception: go exited with 1
[tty 102], line 1: go generate ./...
Putting binaries inside repo will result in vcs.modified=true in the buildinfo,
making the binaries different from those from dl.elv.sh.
Also update the build script to align with https://github.com/elves/up.
Running test and vet with Go 1.17 has uncovered some issues, which breaks CI.
This change will be rolled forward after I have a local Go 1.17 environment and
fix those issues.
This reverts commit 9afb84e4fd.