Skip to content

Handle client init errors #196

Handle client init errors

Handle client init errors #196

Workflow file for this run

name: build
on:
push:
tags: [v\d+.\d+.\d+]
branches: [main]
pull_request:
jobs:
test:
runs-on: ubuntu-latest
container: golang:1.20
strategy:
matrix:
go-version: [1.19.x, 1.20.x]
services:
mqtt:
image: emqx/emqx:latest
ports:
- 1883:1883
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Add .git to safe paths
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Go mod cache
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Tools bin cache
uses: actions/cache@v3
with:
path: .bin
key: ${{ runner.os }}-${{ hashFiles('Makefile') }}
- name: Install jq
uses: dcarbone/[email protected]
- name: Test
run: make ci
env:
BROKER_ADDRESS: 'mqtt:1883'
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
fail_ci_if_error: true
verbose: true