-
Notifications
You must be signed in to change notification settings - Fork 70
67 lines (56 loc) · 1.8 KB
/
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
name: Test xk6-kafka
on:
push:
branches:
- main
tags:
- v*
pull_request:
jobs:
test:
name: Test xk6-kafka
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Go 🧑💻
uses: actions/setup-go@v5
with:
go-version: "1.23"
- name: Run prettier for linting scripts, configs and docs 🧹
uses: creyD/[email protected]
with:
dry: True
- name: Lint code issues 🚨
uses: golangci/golangci-lint-action@v4
with:
skip-pkg-cache: true
- name: Install xk6 and build xk6-kafka 🏗️
run: |
go install go.k6.io/xk6/cmd/xk6@latest
xk6 build --with github.com/mostafa/xk6-kafka@latest=.
- name: Run Zookeeper and Kafka ⚙️
run: |
docker run --detach --rm --name lensesio -p 2181:2181 -p 3030:3030 -p 8081-8083:8081-8083 -p 9581-9585:9581-9585 -p 9092:9092 -e RUNTESTS=0 -e ADV_HOST=127.0.0.1 lensesio/fast-data-dev:latest
sleep 15s
- name: Run Go tests 🔬
run: go test -cover -covermode atomic -coverprofile=profile.cov -v .
- name: Report coverage to coveralls 📈
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: profile.cov
- name: Run all xk6-kafka test scripts 🧪
run: |
for f in $(ls scripts/); do
# Until after we have a setup for SASL Authentication,
# we need to skip this test.
if [ "$f" != "test_sasl_auth.js" ]; then
./k6 run --quiet -d 2s scripts/$f;
fi
done
- name: Stop containers 🛑
if: always()
run: |
docker stop lensesio