-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (61 loc) · 1.45 KB
/
ci.yml
File metadata and controls
63 lines (61 loc) · 1.45 KB
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: CI
on: # yamllint disable-line rule:truthy
push:
branches:
- main
pull_request:
types:
- opened
- synchronize
- reopened
jobs:
format:
name: Check formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 1
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Install dependencies
run: go mod download
- name: Run formatter check
run: gofmt -l .
lint:
name: Run linters
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 1
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Install dependencies
run: go mod download
- name: Install golangci-lint
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | \
sh -s -- -b $(go env GOPATH)/bin v2.1.5
- name: Run linters
run: golangci-lint run
test:
name: Run tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 1
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Install dependencies
run: go mod download
- name: Run tests
run: go test -v ./...