Skip to content

Update deps (#305) #539

Update deps (#305)

Update deps (#305) #539

Workflow file for this run

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/prettier_action@v4.3
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