-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (40 loc) · 1.05 KB
/
test.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: Run Tests
on:
push:
branches:
- main
paths-ignore:
- "*.md"
pull_request:
paths-ignore:
- "*.md"
jobs:
test:
name: Test
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
fail-fast: false
matrix:
go: ['1.17']
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
- id: go-cache-paths
run: |
echo "::set-output name=go-build::$(go env GOCACHE)"
echo "::set-output name=go-mod::$(go env GOMODCACHE)"
- name: Go Build Cache
uses: actions/[email protected]
with:
path: ${{ steps.go-cache-paths.outputs.go-build }}
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
- name: Go Mod Cache
uses: actions/[email protected]
with:
path: ${{ steps.go-cache-paths.outputs.go-mod }}
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
- name: Run Tests
run: go test ./... -race -v -count=1