-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
68 lines (58 loc) · 1.75 KB
/
ci.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
name: CI
on:
push:
branches:
- master
pull_request:
jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix: # Support latest and one minor back
go: ["1.17", "1.18", "1.19"]
env:
GOFLAGS: -mod=readonly
services:
etcd:
image: gcr.io/etcd-development/etcd:v3.5.0
ports:
- 2379
env:
ETCD_LISTEN_CLIENT_URLS: http://0.0.0.0:2379
ETCD_ADVERTISE_CLIENT_URLS: http://0.0.0.0:2379
options: --health-cmd "ETCDCTL_API=3 etcdctl --endpoints http://localhost:2379 endpoint health" --health-interval 10s --health-timeout 5s --health-retries 5
consul:
image: consul:1.10
ports:
- 8500
zk:
image: zookeeper:3.5
ports:
- 2181
eureka:
image: springcloud/eureka
ports:
- 8761
env:
eureka.server.responseCacheUpdateIntervalMs: 1000
steps:
- name: Set up Go
uses: actions/[email protected]
with:
stable: "false"
go-version: ${{ matrix.go }}
- name: Checkout code
uses: actions/checkout@v2
- name: Run tests
env:
ETCD_ADDR: http://localhost:${{ job.services.etcd.ports[2379] }}
CONSUL_ADDR: localhost:${{ job.services.consul.ports[8500] }}
ZK_ADDR: localhost:${{ job.services.zk.ports[2181] }}
EUREKA_ADDR: http://localhost:${{ job.services.eureka.ports[8761] }}/eureka
run: go test -v -race -coverprofile=coverage.coverprofile -covermode=atomic -tags integration ./...
- name: Upload coverage
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.coverprofile