Better CI

This commit is contained in:
Jesse Portnoy
2023-08-04 00:50:51 +01:00
parent 48b37a1547
commit 73f26d30e6
3 changed files with 44 additions and 24 deletions
+19 -11
View File
@@ -3,11 +3,11 @@
name: Go
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
on: [push, pull_request]
defaults:
run:
shell: 'bash -Eeuo pipefail -x {0}'
jobs:
@@ -22,10 +22,18 @@ jobs:
go-version: '1.20'
- name: Build
run: cd examples && go mod tidy && go build syncat.go
run: go build -v
- name: Test
run: |
FMT_ISSUES=$(gofmt -l .)
if test -n "$FMT_ISSUES" ;then printf "gofmt found problems:\n$FMT_ISSUES\n";exit 11; fi
go test -v
run: |
set -e
go install github.com/go-critic/go-critic/cmd/gocritic@latest
go install golang.org/x/tools/cmd/goimports@latest
go install golang.org/x/lint/golint@latest
go install github.com/gordonklaus/ineffassign@latest
pip install pre-commit
pre-commit install
pre-commit run --all-files
go test -v
#- name: Test
#run: go test -v