-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (48 loc) · 1.16 KB
/
ci.yaml
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
name: Go-Query-DSL
on:
push:
branches:
- 'main'
tags:
- 'v*'
pull_request:
branches:
- '*'
jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.22.x
uses: actions/setup-go@v4
with:
go-version: 1.22.x
cache-dependency-path: go.sum
- name: Checkout Code
uses: actions/checkout@v3
- name: go-fmt
run: |
if [ -n "$(gofmt -s -l .)" ]; then
echo "Go code is not formatted, run 'gofmt -s -w .'"
exit 1
fi
- name: go-vet
run: go vet ./...
- name: revive
run: |
go install github.com/mgechev/revive@v1.3.2
revive -config .revive.toml -formatter friendly ./...
test:
name: Test
needs: check
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up Go 1.22.x
uses: actions/setup-go@v4
with:
go-version: 1.22.x
cache-dependency-path: go.sum
- name: Test Go-Query-DSL
run: go test -v -covermode=count -coverprofile=coverage.out ./...