Skip to content

fix(edge_node): unify sequence numbering across node and device messages #20

fix(edge_node): unify sequence numbering across node and device messages

fix(edge_node): unify sequence numbering across node and device messages #20

Workflow file for this run

name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
format-check:
name: Check code formatting
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install clang-format-18
run: |
sudo apt-get update
sudo apt-get install -y clang-format-18
- name: Check C++ formatting
run: ./scripts/format.sh --check
tidy-check:
name: Run clang-tidy checks
runs-on: ubuntu-latest
container: fedora:42
needs: [format-check]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: |
dnf install -y \
gcc-c++ \
clang \
clang-tools-extra \
cmake \
ninja-build \
git \
protobuf-devel \
abseil-cpp-devel \
paho-c-devel \
openssl-devel
- name: Configure CMake
env:
CC: clang
CXX: clang++
run: cmake --preset default
- name: Build (for compile_commands.json)
run: cmake --build build -j$(nproc)
- name: Run clang-tidy
run: ./scripts/tidy.sh --quiet
build-and-test:
name: Build and test
runs-on: ubuntu-latest
container: fedora:42
needs: [tidy-check]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: |
dnf install -y \
gcc-c++ \
clang \
cmake \
ninja-build \
git \
protobuf-devel \
abseil-cpp-devel \
paho-c-devel \
openssl-devel \
mosquitto
- name: Generate TLS certificates
run: |
cd certs
chmod +x generate_certs.sh
./generate_certs.sh
echo "Certificates generated:"
ls -la *.crt *.key
- name: Create password file for authentication tests
run: |
cd certs
mosquitto_passwd -c -b passwordfile admin admin
chmod 600 passwordfile
echo "Password file created with admin/admin"
- name: Start Mosquitto broker with TLS and authentication
run: |
# Use the test configuration which supports:
# - Port 1883: Plain MQTT (anonymous) for existing tests
# - Port 8883: TLS with password auth for authentication tests
mosquitto -c certs/mosquitto_test.conf -d
sleep 3
# Verify plain broker is accessible
timeout 1 mosquitto_sub -h localhost -p 1883 -t test || true
# Verify TLS broker is running
timeout 1 mosquitto_sub -h localhost -p 8883 \
--cafile certs/ca.crt -u admin -P admin -t test || true
echo "Mosquitto started on ports 1883 (plain) and 8883 (TLS)"
- name: Configure CMake
env:
CC: clang
CXX: clang++
run: cmake --preset default
- name: Build
run: cmake --build build -j$(nproc)
- name: Run tests
run: ctest --test-dir build --output-on-failure
- name: Run authentication tests
run: |
echo "=========================================="
echo "Testing Username/Password Authentication"
echo "=========================================="
./build/examples/test_auth_password
echo ""
echo "=========================================="
echo "Testing mTLS Authentication"
echo "=========================================="
./build/examples/test_auth_mtls
echo ""
echo "=========================================="
echo "Testing Combined Authentication (Production Config)"
echo "=========================================="
./build/examples/test_auth_combined
echo ""
echo "=========================================="
echo "All Authentication Tests Passed!"
echo "=========================================="