-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (44 loc) · 1.11 KB
/
ci.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
name: ci
on:
push:
branches:
- main
pull_request:
jobs:
test:
name: Build and test
runs-on: ubuntu-latest
services:
hivemq:
image: hivemq/hivemq-ce:2023.9
ports:
- 1883:1883
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21.x'
- name: Build
run: go build -v ./...
- name: Run Test
env:
MQTT_BROKER_URL: "tcp://localhost:1883"
run: go test -race -v -covermode atomic -coverprofile=covprofile ./...
- name: Install goveralls
run: go install github.com/mattn/goveralls@latest
- name: Send coverage
env:
COVERALLS_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: goveralls -coverprofile=covprofile -service=github
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: '1.21.x'
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.56.2