Commit Graph

83 Commits

Author SHA1 Message Date
Qi Xiao
8851a1d15c CI scripts: handle non-0 exit from curl -f correctly. 2024-02-10 17:55:33 +00:00
Qi Xiao
284f4f154f .github: Use v4 for download-artifact too. 2024-02-10 17:48:53 +00:00
Qi Xiao
e4d13cf231 CI configs: Use curl -f to suppress 404 content. 2024-02-10 17:47:40 +00:00
Qi Xiao
ea88e07e31 Various CI config updates.
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).
2024-02-10 17:34:27 +00:00
Qi Xiao
a7365ec41e .github: Invert the "old-go" matrix parameter, and omit it from job name. 2024-02-10 16:19:20 +00:00
Qi Xiao
6dfa4f623b .github/workflows: Fix step condition.
Expressions that start with ! must use ${{ }} explicitly:
https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idif
2024-01-11 16:31:41 +00:00
Qi Xiao
36e1272fd7 .github/workflows: Clean up workflow definitions.
- 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.
2024-01-11 15:44:50 +00:00
Qi Xiao
6a4204dec5 Bump Go version in CI tasks for checking binaries. 2024-01-10 23:41:51 +00:00
Qi Xiao
d013121af6 Require Go >= 1.20, and bump CI environment versions.
Also:

- Fix new deprecations in Go 1.20.

- Remove the unused .gitlab-ci.yml.
2024-01-10 22:28:18 +00:00
Qi Xiao
b3eaccd7e7 Bump version of staticcheck and codespell. 2023-12-26 20:47:52 +00:00
Qi Xiao
efae7e0644 Bump staticcheck to 0.4.5, and update CONTRIBUTING.md.
Also add comments in both CONTRIBUTING.md and .github/workflows/ci.yml about
keeping the versions in sync.
2023-08-21 00:33:58 -04:00
Kurtis Rader
204eed9aae Fix a typo detected by spellcheck
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.
2023-08-11 21:14:39 -07:00
Qi Xiao
cf23f0cce4 Bump binary builders in CI to 1.20.6. 2023-07-14 00:18:13 +01:00
Qi Xiao
be04173825 Bump Go to 1.20.2 in CI. 2023-03-12 22:43:12 +00:00
Qi Xiao
4b67567b4e Bump required Go version to 1.19, and binaries builders to 1.20.1. 2023-03-03 00:01:26 +00:00
Qi Xiao
531ea80d11 Bump version of staticcheck, fix issues found by new version. 2023-02-26 20:47:25 +00:00
Qi Xiao
4a24084b38 Make tools/check-gen.sh fail if go generate fails.
Also configure the CI workflow to install stringer.
2022-12-29 23:33:16 +00:00
Qi Xiao
a537d12f40 Restructure check targets in Makefile.
- 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.
2022-12-29 23:23:42 +00:00
Qi Xiao
a7e92c3101 Fixup for #1630. 2022-12-29 05:22:57 +00:00
Kurtis Rader
a285ef54b4 Validate generated code is up to date
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 ./...
2022-12-28 13:13:46 +00:00
Qi Xiao
87dbe26957 Bump Go to 1.19.4 in the check_website workflow. 2022-12-15 21:43:13 +00:00
Qi Xiao
c64e0ffd4b
.github: Reduce retention of binary artifacts.
Binary artifacts use a lot of storage, so reduce the retention to save some space.
2022-11-23 01:04:09 +00:00
Qi Xiao
352d544638 Bump versions of GitHub actions.
Also specify python-version in setup-python.
2022-11-23 00:42:03 +00:00
Qi Xiao
3d7b20d4c0 CI: Fix GitHub API URL for fetching the SHA of latest commit. 2022-11-08 23:40:02 +00:00
Qi Xiao
7e15d5a05d Bump Go version in check_website to 1.19.3.
This is to match c67704a8c0.
2022-11-08 18:16:58 +00:00
Qi Xiao
c06da0a3a8 Simplify the check-rellinks CI check.
Pandoc is no longer required, so no need to use the custom elvish-up image.
2022-11-08 14:11:50 +00:00
Qi Xiao
ff169505be Format Markdown files with elvmdfmt. 2022-11-06 12:39:10 +00:00
Qi Xiao
89063ab095 Manually cherry-pick codespell changes from #1613. 2022-10-23 23:57:01 +01:00
Qi Xiao
07791a4631 .github: Bump Go to 1.19.x. 2022-08-08 12:43:29 +01:00
Qi Xiao
bc4193122f Upgrade prettier to 2.7.1. 2022-06-23 20:32:11 +01:00
Qi Xiao
aa6d5a6257 Re-enable staticcheck, and fix issues it found. 2022-05-22 11:57:38 +01:00
Qi Xiao
68c99c99fb Only run check_freshness job for the elves/elvish repo.
Pushes to forks will not trigger website updates.
2022-05-21 13:02:26 +01:00
Qi Xiao
7d8551253a Improve race condition handling of the check_website workflow.
Using cancel-in-progress will cause the workflow to fail, which is not
desirable. Instead, use the GitHub API to fetch the SHA of the latest commit,
and suppress the error from check_binary_checksums if it doesn't match the SHA
of the triggering commit.
2022-05-21 13:01:53 +01:00
Qi Xiao
ddf1ce7402 Pin Go version in the check_website workflow. 2022-05-21 12:03:00 +01:00
Qi Xiao
ac5cb7c8ac Fix the check-rellinks CI task. 2022-05-21 11:45:48 +01:00
Qi Xiao
faebab7001 Small tweaks to check_website. 2022-04-09 22:03:32 +01:00
Qi Xiao
a5bf482db6 Improve check_website workflow.
- Handle the case when commit-ts.txt doesn't exist.

- Use exponential backoff when waiting.
2022-04-09 21:57:38 +01:00
Qi Xiao
defe2f45f9 Make curl silent in the check_website workflow. 2022-04-09 21:38:07 +01:00
Qi Xiao
9027d8369d Configure check_website to cancel in-progress runs.
This is necessary since the check_binary_checksums job will fail if dl.elv.sh
hosts the build from a newer commit.
2022-04-03 22:35:14 +01:00
Qi Xiao
f2a7dfeaa5 Fix working directory in the check binary CI task (hopefully). 2022-04-03 01:54:16 +01:00
Qi Xiao
b7e5e6e5c5 Compare binaries built by GitHub Actions with those from dl.elv.sh.
Also only do this on push to the master branch.
2022-04-03 01:51:11 +01:00
Qi Xiao
35cbf6a2b8 In GitHub CI, don't put built binaries inside repo.
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.
2022-04-02 22:36:39 +01:00
Qi Xiao
f7cb556d9b Require Go 1.18.
- Run "go fix" to remove legacy build tags

- Use staticcheck@master until it has a release that supports Go 1.18

- Turn off autocrlf for Windows tasks
2022-03-20 15:28:23 +00:00
Qi Xiao
9185e04b69 Add a tool to check "forbidden" content.
Also add a Makefile target and CI task for it.
2022-02-20 23:22:33 +00:00
Qi Xiao
16164f413f Disable CGo in check-rellinks. 2021-11-29 21:28:34 +00:00
Qi Xiao
f3dd676ead Try running check-rellinks as root 2021-11-29 21:26:41 +00:00
Qi Xiao
e9b3a4c800 Add missing sudo 2021-11-29 21:18:47 +00:00
Qi Xiao
113c4dee9c Fix permission of /go in check-rellinks 2021-11-29 21:17:35 +00:00
Qi Xiao
d94779da33 Try workaround of specifying "--user 1001" in check-rellinks.
https://github.com/actions/checkout/issues/211#issuecomment-680107607
2021-11-29 20:55:12 +00:00
Qi Xiao
22981175db Inspect the content of github workspace 2021-11-29 20:51:42 +00:00