-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (49 loc) · 1.48 KB
/
go.yml
File metadata and controls
62 lines (49 loc) · 1.48 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
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Go
on:
push:
branches: [ "root" ]
pull_request:
branches: [ "root" ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.24'
cache: true
- name: Get dependencies
run: |
go mod download
go mod verify
- name: Verify formatting
run: |
gofmt -l . > gofmt_diff.txt
if [ -s gofmt_diff.txt ]; then
echo "Run 'go fmt ./...' to fix formatting"
cat gofmt_diff.txt
exit 1
fi
- name: Vet
run: go vet ./...
- name: Install golangci-lint
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.64.6
- name: Run golangci-lint
run: golangci-lint run ./...
- name: Build
run: go build -v ./...
- name: Test with Race Detector and Coverage
run: go test -race -coverprofile=coverage.out -covermode=atomic -v ./...
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }} # optional, but required for private repos
file: ./coverage.out
flags: unittests
name: codecov-umbrella