Skip to content

Commit

Permalink
mosquitto
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Bozarth <[email protected]>
  • Loading branch information
ajbozarth committed Nov 25, 2024
1 parent 1d3f07d commit cbe67c9
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ jobs:
with:
build_main: ${{ github.event.inputs.build_main }}

mosquitto:
uses: ./.github/workflows/mosquitto.yml
with:
build_main: ${{ github.event.inputs.build_main }}

nginx:
uses: ./.github/workflows/nginx.yml
with:
Expand Down
60 changes: 60 additions & 0 deletions .github/workflows/mosquitto.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Build & Test - mosquitto

on:
push:
branches: [ 'main' ]
paths: ['.github/workflows/mosquitto.yml', 'mosquitto/**']
pull_request:
branches: [ 'main' ]
paths: ['.github/workflows/mosquitto.yml', 'mosquitto/**']
workflow_call:
inputs:
build_main:
description: "Build using liboqs and oqsprovider main branches"
required: false
default: false
type: boolean

env:
build-args: |
LIBOQS_TAG=main
OQSPROVIDER_TAG=main
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform:
- linux/amd64
- linux/arm64
steps:
- uses: actions/checkout@v3
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build the Docker image
uses: docker/build-push-action@v6
with:
load: true
context: mosquitto
platforms: ${{ matrix.platform }}
build-args: |
${{ (github.event.inputs.build_main == 'true') && env.build-args || null }}
tags: oqs-mosquitto

- name: Test mosquitto using local docker network
run: |
docker network create --subnet=192.168.0.0/16 mosquitto-test &&
docker run --network mosquitto-test --ip 192.168.0.2 -it --rm --name oqs-mosquitto-broker -e "BROKER_IP=192.168.0.2" -e "EXAMPLE=broker-start.sh" -d oqs-mosquitto &&
docker run --network mosquitto-test --ip 192.168.0.3 -it --rm --name oqs-mosquitto-subscriber -e "BROKER_IP=192.168.0.2" -e "SUB_IP=192.168.0.3" -e "EXAMPLE=subscriber-start.sh" -d oqs-mosquitto &&
docker run --network mosquitto-test --ip 192.168.0.4 -it --rm --name oqs-mosquitto-publisher -e "BROKER_IP=192.168.0.2" -e "PUB_IP=192.168.0.4" -e "EXAMPLE=publisher-start.sh" -d oqs-mosquitto &&
sleep 2 &&
docker logs oqs-mosquitto-publisher | grep "Client_pub sending PUBLISH" &&
docker logs oqs-mosquitto-subscriber | grep "Hello world"

0 comments on commit cbe67c9

Please sign in to comment.