Commit Graph

57 Commits

Author SHA1 Message Date
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
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
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
352d544638 Bump versions of GitHub actions.
Also specify python-version in setup-python.
2022-11-23 00:42:03 +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
ac5cb7c8ac Fix the check-rellinks CI task. 2022-05-21 11:45:48 +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
Qi Xiao
383e2bf718 Try to fix workspace setup in check-rellinks 2021-11-29 20:47:20 +00:00
Qi Xiao
e060a6842a Use "shell: sh" to the check-rellinks step. 2021-11-29 20:44:03 +00:00
Qi Xiao
9bebf437ff Set up workspace dir in check-rellinks 2021-11-29 20:40:26 +00:00
Qi Xiao
697f038d3d Try using the elves/up image for check-rellinks. 2021-11-29 20:23:30 +00:00
Qi Xiao
9f3204966d Add a missing sudo when installing pandoc 2021-11-29 20:17:47 +00:00
Qi Xiao
927a4fff1e Install pandoc in the check-rellinks workflow. 2021-11-29 20:15:00 +00:00
Qi Xiao
ce7c4e5095 Add step to set up Go when checking relative links.
The workflow requires building the website, which requires an up-to-date version of Go.
2021-11-29 20:09:56 +00:00
Qi Xiao
4578732c9c Check relative links as part of the CI. 2021-11-29 20:06:12 +00:00
Qi Xiao
371695f07b Merge the SourceGraph LSIF workflow into the CI workflow. 2021-10-01 22:24:51 +01:00
Qi Xiao
1869cd5f35 Revert "Revert "Require Go >= 1.16.""
Elvish now builds cleanly with Go 1.17.

This reverts commit 066f23d04f.
2021-08-23 00:23:55 +01:00
Qi Xiao
066f23d04f Revert "Require Go >= 1.16."
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.
2021-08-22 23:40:48 +01:00
Qi Xiao
4b34485cc1 Document use of codespell and pin the version in GitHub Actions.
Also move list of ignored words into .codespellrc so that the list is shared
between GitHub Actions and local runs.
2021-08-22 23:24:39 +01:00
Qi Xiao
9afb84e4fd Require Go >= 1.16. 2021-08-22 23:07:54 +01:00
Shengjing Zhu
5724ec4c47 Fix typos and add codespell to CI 2021-08-22 23:07:34 +01:00
Qi Xiao
c849d83164 Fix test of website/cmd/elvdoc, and add it to CI and the test target.
The website directory is a separate Go module, so it's not included by ./... and
tests there have to be run explicitly.
2021-08-21 16:51:19 +01:00
Qi Xiao
66fa3d6e88 Skip normal tests in the benchmar workflow of GitHub Actions. 2021-08-06 23:49:50 +01:00
Qi Xiao
8077c8bb85 Fix ci.yml 2021-08-01 21:58:00 +01:00
Qi Xiao
9442d4b6f6 Add benchmark running to GitHub Actions. 2021-08-01 21:43:52 +01:00