-
-
Notifications
You must be signed in to change notification settings - Fork 6
40 lines (35 loc) · 947 Bytes
/
ci.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
on: [push, pull_request]
name: CI
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: "1.23.3"
check-latest: true
- name: Checkout repository
uses: actions/checkout@v4
# Format
- name: Check formatting
run: |
if [ -n "$(go fmt ./...)" ]; then
echo " Code is not properly formatted. Please run 'make fmt' locally."
exit 1
fi
# Vet
- name: Run go vet
continue-on-error: true
run: go vet ./...
# Lint
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: latest
# Test
- name: Test and calculate coverage
run: go test -v -covermode=count -coverprofile=coverage.out ./...
# Try compile
- name: Compile
run: go build -o /dev/null .