Commit Graph

68 Commits

Author SHA1 Message Date
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
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
388ac81a8c Only run the check_website action when pushing to master. 2021-11-22 12:34:21 +00:00
Qi Xiao
7446c60af4 check_website.yml: Check cdg.elv.sh and hkg.elv.sh
The latter will be used later to be the APAC backend for elv.sh, and is now
building website on each commit.
2021-10-09 23:53:19 +01:00
Qi Xiao
d5f662485d Update website checking script.
- Add sleep between checks

- Add output when check succeeds
2021-10-09 22:57:04 +01:00
Qi Xiao
973752cf5a Add GitHub Action to check website is updated within 30 minutes. 2021-10-09 22:54:30 +01: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