Skip to content

Support for message hub 0.7.0 #220

Support for message hub 0.7.0

Support for message hub 0.7.0 #220

# This file is part of Astarte.
#
# Copyright 2024 SECO Mind Srl
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
name: Check examples MQTT
on: [pull_request]
env:
PB_REL: https://github.com/protocolbuffers/protobuf/releases
jobs:
check-examples-mqtt:
runs-on: ubuntu-latest
concurrency:
group: check-examples-mqtt-${{ github.ref }}
cancel-in-progress: true
timeout-minutes: 30
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Create Astarte Cluster
uses: astarte-platform/astarte-cluster-action@v1
with:
astarte_version: "1.2.0"
- name: Install interface
working-directory: ./.github/workflows
timeout-minutes: 3
run: |
./install_interfaces.sh $GITHUB_WORKSPACE/examples/mqtt/interfaces
- name: Setup the configuration file for the example
working-directory: ./examples/mqtt
run: |
echo "REALM = \"test\"" > config.toml
echo "PAIRING_URL = \"https://api.autotest.astarte-platform.org/pairing\"" >> config.toml
DEVICE_ID=$(astartectl utils device-id generate-random)
echo "DEVICE_ID = \"$DEVICE_ID\"" >> config.toml
CREDENTIALS_SECRET=$(astartectl pairing agent register --compact-output -- "$DEVICE_ID")
echo "CREDENTIALS_SECRET = \"$CREDENTIALS_SECRET\"" >> config.toml
cat config.toml
- name: Install the Astarte device Python module
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -e .
- name: Execute the example
working-directory: ./examples/mqtt
run: |
export REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
python3 ./main.py