-
Notifications
You must be signed in to change notification settings - Fork 38
53 lines (41 loc) · 1.41 KB
/
go.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
name: Go
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build_n_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.21'
- name: Install xk6
run: go install go.k6.io/xk6/cmd/xk6@latest
- name: Run mqtt broker
run: docker run -p 1883:1883 -e "DOCKER_VERNEMQ_ACCEPT_EULA=yes" -e DOCKER_VERNEMQ_ALLOW_ANONYMOUS=on --name vernemq -d vernemq/vernemq
- name: Go tests
run: go test -race ./...
- name: Test from source
run: xk6 build --with github.com/pmalhaire/xk6-mqtt=. && ./k6 run --vus 50 --duration 10s examples/test.js
- name: Test tls
run: docker run -d -v $PWD/docker_conf/mosquitto:/conf --rm --name mosquitto_tls -p 8883:8883 eclipse-mosquitto mosquitto -c /conf/mosquitto-tls.conf
- name: Test tls from source
run: xk6 run ./examples/test_ssl.js -i 1
- name: Run influx
run: docker run --rm --name influx -d -p 8086:8086 influxdb:1.8-alpine
- name: Test influx
run: K6_OUT=influxdb=localhost:8086 xk6 run --vus 50 --duration 10s examples/test.js
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
with:
go-version: '1.21'
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3