-
Notifications
You must be signed in to change notification settings - Fork 2
80 lines (80 loc) · 2.45 KB
/
tests.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
72
73
74
75
76
77
78
79
80
name: tests
on:
push:
branches: [ main ]
pull_request:
workflow_dispatch:
jobs:
unit:
strategy:
fail-fast: false
matrix:
go-version: [ 1.18.x, 1.19.x, 1.20.x ]
os: [ ubuntu, windows, macOS ]
concurrency:
group: unit-${{ github.ref }}-${{ matrix.os }}-${{ matrix.go-version }}
cancel-in-progress: true
env:
OS: ${{ matrix.os }}-latest
GO: ${{ matrix.go-version }}
runs-on: ${{ matrix.os }}-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
cache: true
- name: Test
run: go test -race -coverprofile unit.txt -covermode atomic ./internal/...
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v3
with:
file: ./unit.txt
flags: unit,${{ matrix.os }},go-${{ matrix.go-version }}
name: unit
integration:
strategy:
fail-fast: false
matrix:
go-version: [ 1.18.x, 1.19.x, 1.20.x ]
ydb-version: [ 22.5, 23.1, 23.2 ]
concurrency:
group: integration-${{ github.ref }}-${{ matrix.go-version }}-${{ matrix.ydb-version }}
cancel-in-progress: true
runs-on: ubuntu-latest
services:
ydb:
image: cr.yandex/yc/yandex-docker-local-ydb:${{ matrix.ydb-version }}
ports:
- 2135:2135
- 2136:2136
- 8765:8765
volumes:
- /tmp/ydb_certs:/ydb_certs
env:
YDB_LOCAL_SURVIVE_RESTART: true
YDB_USE_IN_MEMORY_PDISKS: true
options: '-h localhost'
env:
OS: ubuntu-latest
GO: ${{ matrix.go-version }}
YDB_CONNECTION_STRING: grpc://localhost:2136/local
YDB_ANONYMOUS_CREDENTIALS: 1
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
cache: true
- name: Integration test
run: go test -race -coverpkg=./internal/... -coverprofile integration.txt -covermode atomic ./tests/integration/...
- name: Upload Test secure connection coverage report to Codecov
uses: codecov/codecov-action@v3
with:
file: ./integration.txt
flags: integration,go-${{ matrix.go-version }},ydb-${{ matrix.ydb-version }}
name: integration