-
Notifications
You must be signed in to change notification settings - Fork 136
45 lines (34 loc) · 1.07 KB
/
go.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
41
42
43
44
45
# This workflow will builds and tests Termdash.
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Go
on:
push:
branches: [ "master", "devel" ]
pull_request:
branches: [ "master", "devel" ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [ '1.20', '1.21', 'stable' ]
steps:
- uses: actions/checkout@v4
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Install dependencies
run: |
go install golang.org/x/tools/cmd/cover@latest
go install github.com/mattn/goveralls@latest
go install golang.org/x/lint/golint@latest
go get -t ./...
- name: Test
run: go test -v -covermode=count -coverprofile=coverage.out ./...
- name: Test Race
run: CGO_ENABLED=1 go test -race ./...
- name: Format
run: diff -u <(echo -n) <(gofmt -d -s .)
- name: Lint
run: diff -u <(echo -n) <(golint ./...)