-
Notifications
You must be signed in to change notification settings - Fork 113
71 lines (56 loc) · 1.92 KB
/
unit-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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Test GoShimmer
on:
pull_request:
paths-ignore:
- 'docs/**'
jobs:
unit-tests:
name: Unit tests
runs-on: ubuntu-latest
steps:
- name: Setup Go 1.20
uses: actions/setup-go@v1
with:
go-version: 1.20
- name: Checkout repository
uses: actions/checkout@v3
- name: Cache Go build and dependencies
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
# make sure concurrent runs (not really supported) do not match the same key but instead fall back to a reasonable cache
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}-${{ github.event.action }}${{ github.event.after }}
restore-keys: |
${{ runner.os }}-go-${{ hashFiles('go.sum') }}
${{ runner.os }}-go-
- name: Print Go version
run: go version
- name: Run Tests
run: go test ./... -tags rocksdb -count=1 -timeout 10m
unit-tests-race:
name: Unit tests -race
runs-on: ubuntu-latest
steps:
- name: Setup Go 1.20
uses: actions/setup-go@v1
with:
go-version: 1.20
- name: Checkout repository
uses: actions/checkout@v3
- name: Cache Go build and dependencies
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
# make sure concurrent runs (not really supported) do not match the same key but instead fall back to a reasonable cache
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}-${{ github.event.action }}${{ github.event.after }}
restore-keys: |
${{ runner.os }}-go-${{ hashFiles('go.sum') }}
${{ runner.os }}-go-
- name: Print Go version
run: go version
- name: Run Tests with -race
run: go test ./... -tags rocksdb -count=1 -race -short -timeout 20m