-
Notifications
You must be signed in to change notification settings - Fork 31
143 lines (137 loc) · 4 KB
/
build.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
name: Build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: 1.17
- uses: actions/cache@v3
with:
path: /home/runner/.cache/go-build
key: GOCACHE-v2-${{ hashFiles('**/go.mod') }}
- uses: actions/cache@v3
with:
path: /home/runner/go/pkg/mod
key: GOMODCACHE-v2-${{ hashFiles('**/go.mod') }}
- run: make kubebuilder name=linux
- run: go mod download
- run: make test
- run: bash <(curl -s https://codecov.io/bash)
codegen:
runs-on: ubuntu-latest
needs: [ test ]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: 1.17
- uses: actions/setup-python@v4
with:
python-version: '3.9'
- uses: actions/cache@v3
with:
path: /home/runner/.cache/go-build
key: GOCACHE-v2-${{ hashFiles('**/go.mod') }}
- uses: actions/cache@v3
with:
path: /home/runner/go/pkg/mod
key: GOMODCACHE-v2-${{ hashFiles('**/go.mod') }}
- run: sudo apt install -y protobuf-compiler
- run: make codegen
- run: git diff --exit-code
lint:
runs-on: ubuntu-latest
needs: [ test, codegen ]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: 1.17
- uses: actions/cache@v3
with:
path: /home/runner/.cache/go-build
key: GOCACHE-v2-${{ hashFiles('**/go.mod') }}
- uses: actions/cache@v3
with:
path: /home/runner/go/pkg/mod
key: GOMODCACHE-v2-${{ hashFiles('**/go.mod') }}
- run: make lint
- run: git diff --exit-code
# it = integration test
it:
runs-on: ubuntu-latest
needs: [ test, codegen, lint ]
strategy:
fail-fast: false
max-parallel: 2
matrix:
suite:
- db-e2e
- e2e
- examples
- http-fmea
- http-stress
- hpa
- kafka-e2e
- kafka-fmea
- kafka-stress
- s3-e2e
- stan-e2e
- stan-fmea
- stan-stress
- jetstream-e2e
- jetstream-stress
- jetstream-fmea
env:
KUBECONFIG: /etc/rancher/k3s/k3s.yaml
steps:
- uses: actions/checkout@v3
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Install and start K3S
timeout-minutes: 3
run: |
curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.21.2+k3s1 INSTALL_K3S_CHANNEL=stable INSTALL_K3S_EXEC=--docker K3S_KUBECONFIG_MODE=644 sh -
until kubectl cluster-info ; do sleep 10s ; done
- uses: actions/setup-go@v4
with:
go-version: "1.17"
- uses: actions/cache@v3
with:
path: /home/runner/.cache/go-build
key: GOCACHE-v2-${{ hashFiles('**/go.mod') }}
- uses: actions/cache@v3
with:
path: /home/runner/go/pkg/mod
key: GOMODCACHE-v2-${{ hashFiles('**/go.mod') }}
- run: make controller
- run: make testapi
- run: make deploy CONFIG=ci
- run: make runner
- run: make runtimes
if: ${{matrix.suite == 'e2e' || matrix.suite == 'examples'}}
- run: docker pull golang:1.17
- run: make wait
- run: make logs > /tmp/logs &
- run: make test-${{matrix.suite}}
- run: git diff
- name: cat logs
if: ${{ failure() }}
run: cat /tmp/logs
- name: controller logs
if: ${{ failure() }}
run: kubectl -n argo-dataflow-system logs deploy/controller-manager -c manager