-
Notifications
You must be signed in to change notification settings - Fork 3
48 lines (41 loc) · 1023 Bytes
/
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
46
47
48
name: Build & Test
on:
push:
branches-ignore:
- master
jobs:
build-test:
runs-on: ubuntu-latest
services:
redis:
image: redis
ports:
- 6379:6379
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.21
- name: Restore cache
uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
~/.cache/go-build
vendor
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Build and test
run: |
go mod tidy
go mod vendor
go vet ./...
go build ./...
go test -v ./... | sed ''/PASS/s//$(printf "\033[32mPASS\033[0m")/'' | sed ''/FAIL/s//$(printf "\033[31mFAIL\033[0m")/''
env:
GOOS: linux
GOARCH: amd64
GOFLAGS: -mod=vendor
CGO_ENABLED: 0