Make tools/check-gen.sh fail if go generate fails.

Also configure the CI workflow to install stringer.
This commit is contained in:
Qi Xiao 2022-12-29 23:33:16 +00:00
parent a537d12f40
commit 4a24084b38
2 changed files with 11 additions and 7 deletions

View File

@ -110,12 +110,16 @@ jobs:
uses: actions/setup-go@v3
with:
go-version: 1.19.x
- name: Install goimports
run: go install golang.org/x/tools/cmd/goimports@latest
- name: Install codespell
run: pip install codespell==2.2.1
- name: Install staticcheck
run: go install honnef.co/go/tools/cmd/staticcheck@v0.3.2
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install tools
run: |
go install golang.org/x/tools/cmd/stringer@latest
go install golang.org/x/tools/cmd/goimports@latest
go install honnef.co/go/tools/cmd/staticcheck@v0.3.2
pip install --user codespell==2.2.1
- name: Run checks
run: make all-checks

View File

@ -18,7 +18,7 @@ if test "$(git_unstaged)" != ""; then
exit 1
fi
go generate ./...
go generate ./... || exit 1
x=$(git_unstaged)
if test "$x" != ""; then