-
Notifications
You must be signed in to change notification settings - Fork 265
37 lines (27 loc) · 1.09 KB
/
example.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
name: MQTT Broker Example
on: [push]
jobs:
mqtt:
runs-on: ubuntu-latest
services:
mosquitto:
image: eclipse-mosquitto:latest
ports:
- 1883:1883
volumes:
- ${{ github.workspace}}/test/functionalTest/mosquittoConf:/mosquitto/config
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install mosquitto clients
run: sudo apt-get update && sudo apt-get install -y mosquitto-clients
- name: Publish anonymously
run: mosquitto_pub -h localhost -p 1883 -t "test/topic" -m "Hello from anonymous"
- name: Publish with user1
run: mosquitto_pub -h localhost -p 1883 -u user1 -P xxxx -t "test/topic" -m "Hello from user1"
# Create a mosquitto.conf file in the same directory with the following content:
# listener 1883
# allow_anonymous true
# password_file /mosquitto/config/passwordfile
# Create a password file with the following command:
# mosquitto_passwd -c /mosquitto/config/passwordfile user1