-
Notifications
You must be signed in to change notification settings - Fork 49
84 lines (79 loc) · 2.06 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
81
82
83
84
name: Go tests
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
go-test:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [ '1.22', '1.23' ]
services:
etcd:
image: bitnami/etcd
env:
ALLOW_NONE_AUTHENTICATION: yes
ports:
- 2379:2379
redis:
image: bitnami/redis
env:
ALLOW_EMPTY_PASSWORD: yes
ports:
- 6379:6379
redis-cluster:
image: grokzen/redis-cluster:7.0.10
env:
IP: 0.0.0.0
INITIAL_PORT: 11000
ports:
- 11000-11005:11000-11005
memcached:
image: bitnami/memcached
ports:
- 11211:11211
consul:
image: bitnami/consul
ports:
- 8500:8500
zookeeper:
image: bitnami/zookeeper
env:
ALLOW_ANONYMOUS_LOGIN: yes
ports:
- 2181:2181
postgresql:
image: bitnami/postgresql
env:
ALLOW_EMPTY_PASSWORD: yes
ports:
- 5432:5432
steps:
- uses: actions/checkout@v4
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Setup DynamoDB Local
uses: rrainn/[email protected]
with:
port: 8000
- name: Run tests
env:
ETCD_ENDPOINTS: 'localhost:2379'
REDIS_ADDR: 'localhost:6379'
REDIS_NODES: 'localhost:11000,localhost:11001,localhost:11002,localhost:11003,localhost:11004,localhost:11005'
CONSUL_ADDR: 'localhost:8500'
ZOOKEEPER_ENDPOINTS: 'localhost:2181'
AWS_ADDR: 'localhost:8000'
MEMCACHED_ADDR: '127.0.0.1:11211'
POSTGRES_URL: postgres://postgres@localhost:5432/?sslmode=disable
run: go test -race -v -coverprofile=coverage.txt -covermode=atomic ./...
- uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true