Skip to content

Commit

Permalink
Run CI tests against Mosquitto 2.0 (#111)
Browse files Browse the repository at this point in the history
* Test against Mosquitto 2.0

* Set group permissions for .ci/tls files

* Try read permissions for all users

* Allow anonymous clients when testing against Mosquitto 2.0
  • Loading branch information
Namoshek authored May 26, 2022
1 parent c6046be commit cae8ac8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .ci/mosquitto.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ cafile /mosquitto-certs/ca.crt
certfile /mosquitto-certs/server.crt
keyfile /mosquitto-certs/server.key
require_certificate false
allow_anonymous true

# TLS listener with client certificate requirement
listener 8884
cafile /mosquitto-certs/ca.crt
certfile /mosquitto-certs/server.crt
keyfile /mosquitto-certs/server.key
require_certificate true
allow_anonymous true
22 changes: 17 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
strategy:
matrix:
php-version: ['7.4', '8.0', '8.1']
mqtt-broker: ['mosquitto', 'hivemq', 'emqx', 'rabbitmq']
mqtt-broker: ['mosquitto-1.6', 'mosquitto-2.0', 'hivemq', 'emqx', 'rabbitmq']
include:
- php-version: '8.1'
mqtt-broker: 'mosquitto'
mqtt-broker: 'mosquitto-2.0'
run-sonarqube-analysis: true

steps:
Expand Down Expand Up @@ -63,17 +63,29 @@ jobs:
run: composer install --prefer-dist

- name: Generate certificates for tests
run: sh create-certificates.sh
run: |
sh create-certificates.sh
chmod u+rx,g+rx ${{ github.workspace }}/.ci/tls
chmod a+r ${{ github.workspace }}/.ci/tls/*
- name: Start Mosquitto message broker
if: matrix.mqtt-broker == 'mosquitto'
- name: Start Mosquitto 1.6 message broker
if: matrix.mqtt-broker == 'mosquitto-1.6'
uses: Namoshek/mosquitto-github-action@v1
with:
version: '1.6'
ports: '1883:1883 8883:8883 8884:8884'
certificates: ${{ github.workspace }}/.ci/tls
config: ${{ github.workspace }}/.ci/mosquitto.conf

- name: Start Mosquitto 2.0 message broker
if: matrix.mqtt-broker == 'mosquitto-2.0'
uses: Namoshek/mosquitto-github-action@v1
with:
version: '2.0'
ports: '1883:1883 8883:8883 8884:8884'
certificates: ${{ github.workspace }}/.ci/tls
config: ${{ github.workspace }}/.ci/mosquitto.conf

- name: Start HiveMQ message broker
if: matrix.mqtt-broker == 'hivemq'
uses: Namoshek/hivemq4-github-action@v1
Expand Down

0 comments on commit cae8ac8

Please sign in to comment.