-
Notifications
You must be signed in to change notification settings - Fork 28
154 lines (132 loc) · 4.21 KB
/
pr_build_and_test.yaml
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
144
145
146
147
148
149
150
151
152
153
154
# Copyright 2023 StreamNative, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Build
on:
pull_request:
branches:
- main
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
MAELSTROM_VERSION: "0.2.3"
jobs:
build:
name: Build & Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.22
- name: Install protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Installing Go dependencies
run: |
go install google.golang.org/protobuf/cmd/[email protected]
go install google.golang.org/grpc/cmd/[email protected]
go install github.com/palantir/go-license@latest
- run: make license-check
- name: Build
run: make build
- name: golangci-lint
uses: golangci/[email protected]
with:
version: v1.61.0
args: --timeout=10m
- name: Test
run: make test
chaos-mesh:
name: Run chaos-mesh
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build docker
uses: docker/build-push-action@v3
with:
context: .
push: false
tags: oxia:latest
cache-from: type=registry,ref=oxia:latest
cache-to: type=inline
- uses: helm/[email protected]
with:
cluster_name: kind
kubectl_version: v1.25.5
- name: Deploy oxia
run: |
kubectl create namespace oxia
kind load docker-image oxia:latest
helm -n oxia install oxia \
-f deploy/chaos-mesh/oxia-cluster.yaml \
deploy/charts/oxia-cluster
sleep 30
kubectl -n oxia run perf \
--image=oxia:latest --image-pull-policy=Never \
--command -- oxia perf -a oxia:6648
- name: Encode chaos-mesh config
run: echo "CFG_BASE64=$(base64 -w0 deploy/chaos-mesh/chaos-mesh.yaml)" >> $GITHUB_ENV
- name: Run chaos-mesh
uses: chaos-mesh/chaos-mesh-action@master # v0.5 is broken
env:
CHAOS_MESH_VERSION: v2.5.1
# CFG_BASE64: set by previous step
- name: Wait for workflow completion
run: sleep 120
- name: Print pods
run: kubectl -n oxia get pods
- name: Print coordinator logs
run: kubectl -n oxia logs -l app.kubernetes.io/component=coordinator
- name: Print perf logs
run: kubectl -n oxia logs perf
maelstrom:
name: Maelstrom
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.22
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
- name: Install Gnuplot
run: |
sudo apt-get update && sudo apt-get install -y gnuplot
- run: make
- run: make maelstrom
- name: Download Maelstrom
run: |
curl -O -L https://github.com/jepsen-io/maelstrom/releases/download/v${MAELSTROM_VERSION}/maelstrom.tar.bz2
tar xf maelstrom.tar.bz2
- name: Run Maelstrom test
run: |
cd maelstrom
./maelstrom test -w lin-kv --bin ../bin/oxia-maelstrom \
--time-limit 60 --concurrency 2n --latency 10 --latency-dist uniform
- name: Upload test results
uses: actions/upload-artifact@v3
if: failure()
with:
name: maelstrom-result
path: maelstrom/store