-
Notifications
You must be signed in to change notification settings - Fork 1
63 lines (61 loc) · 1.89 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Tests
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
run-tests:
runs-on: ubuntu-latest
strategy:
matrix:
go: [ '1.20', '1.x' ]
name: With Go ${{ matrix.go }}
steps:
- uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
check-latest: true
- name: Get dependencies
run: go get -v -t -d ./...
- name: Test
run: go test -race ./...
static-checks:
runs-on: ubuntu-latest
strategy:
matrix:
go: [ '1.x' ]
name: Static checks
steps:
- uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
check-latest: true
- name: Get dependencies
run: go get -v -t -d ./...
- name: Go Vet
run: go vet ./...
- name: Go Fmt
run: |
fmt=$(gofmt -l .)
test -z $fmt || (echo "please run gofmt" ; echo $fmt ; exit 1)
- name: Go Lint
run: go run golang.org/x/lint/golint@latest -set_exit_status $(go list ./... | grep -v otto/)
- name: Spelling
run: |
go run github.com/client9/misspell/cmd/misspell@latest -error ./example
go run github.com/client9/misspell/cmd/misspell@latest -error ./puganalyse
go run github.com/client9/misspell/cmd/misspell@latest -error ./pugjs
go run github.com/client9/misspell/cmd/misspell@latest -error ./templatefunctions
- name: In effective assignments
run: |
go run github.com/gordonklaus/ineffassign@latest ./example
go run github.com/gordonklaus/ineffassign@latest ./puganalyse
go run github.com/gordonklaus/ineffassign@latest ./pugjs
go run github.com/gordonklaus/ineffassign@latest ./templatefunctions