-
Notifications
You must be signed in to change notification settings - Fork 68
67 lines (59 loc) · 1.73 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Test
on:
push:
tags:
- v*
branches:
- master
pull_request:
jobs:
test:
strategy:
matrix:
go-version: [1.18.x, 1.19.x]
env:
GO: ${{ matrix.go-version }}
runs-on: ubuntu-latest
services:
mssql:
image: mcr.microsoft.com/mssql/server:2019-latest
env:
SA_PASSWORD: p@sSword
ACCEPT_EULA: "Y"
ports:
- 1433:1433
steps:
- name: Download CockroachDB Binary
run: |
wget -qO- https://binaries.cockroachdb.com/cockroach-v20.1.3.linux-amd64.tgz | tar xvz
sudo cp -i cockroach-v20.1.3.linux-amd64/cockroach /usr/local/bin/
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v3
# Cache go build cache, used to speedup go test
- name: Go Build Cache
uses: actions/cache@v3
with:
path: $(go env GOCACHE)
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
# Cache go mod cache, used to speedup builds
- name: Go Mod Cache
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
- name: Test
run: go test --tags with_mssql -v -race -coverprofile=coverage.txt -covermode=atomic ./... --cockroach-binary cockroach
- name: Upload Codecov
uses: codecov/codecov-action@v3
with:
files: ./coverage.txt
flags: unittests
env_vars: GO
name: codecov-umbrella
fail_ci_if_error: true
path_to_write_report: ./codecov_report.txt
verbose: true