-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (39 loc) · 1001 Bytes
/
test.yml
File metadata and controls
47 lines (39 loc) · 1001 Bytes
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
name: CI
on:
push:
branches: [ main ]
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
check-latest: true
cache: true
- name: Go version
run: go version
- name: Check formatting
run: |
files=$(gofmt -s -l .)
if [ -n "$files" ]; then
echo "The following files are not gofmt'ed:" >&2
echo "$files" >&2
echo "Run: gofmt -s -w ." >&2
exit 1
fi
- name: Vet
run: go vet ./...
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
continue-on-error: true
with:
# Use the latest stable golangci-lint; pin if you prefer.
version: latest
args: --timeout=5m
- name: Run tests
run: go test ./...