Skip to content

[Go] Update mqtt to 0.4.1 #3103

[Go] Update mqtt to 0.4.1

[Go] Update mqtt to 0.4.1 #3103

Workflow file for this run

name: CI-Go
on:
workflow_dispatch:
pull_request:
paths:
- '.github/**'
- 'go/**'
- 'eng/test/test-cases/Protocol/**'
- 'codegen/src/**'
- '!codegen/src/Azure.Iot.Operations.ProtocolCompiler/T4/communication'
- 'codegen/src/Azure.Iot.Operations.ProtocolCompiler/T4/communication/common'
- 'codegen/src/Azure.Iot.Operations.ProtocolCompiler/T4/communication/go'
- '!codegen/src/Azure.Iot.Operations.ProtocolCompiler/T4/encapsulation'
- 'codegen/src/Azure.Iot.Operations.ProtocolCompiler/T4/encapsulation/common'
- 'codegen/src/Azure.Iot.Operations.ProtocolCompiler/T4/encapsulation/go'
- 'eng/test/faultablemqttbroker/**'
- 'tools/deployment/**'
push:
branches:
- main
schedule:
- cron: '0 11 * * *' # Nightly at 4am PST
# only allow one run / branch at a time
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
permissions:
contents: read
actions: read
checks: write
jobs:
build:
name: CI-go
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Install AIO
uses: ./.github/actions/configure-aio
with:
wait-for-broker: 'true'
install-dotnet: 'true'
install-go: 'true'
action-token: ${{ secrets.AIO_SDKS_ACTION_TOKEN }}
# This file is created by configure-aio
- name: Load test service account token into environment
run: |
if [ ! -f ".session/token.txt" ]; then
echo "Missing 'token.txt' file"
exit 1
fi
echo "TOKEN_FILE_PATH=$(pwd)/.session/token.txt" >> $GITHUB_ENV
# This file is created by configure-aio
- name: Load CA certificate into environment
run: |
if [ ! -f ".session/broker-ca.crt" ]; then
echo "Missing 'broker-ca.crt' file"
exit 1
fi
echo "CA_FILE_PATH=$(pwd)/.session/broker-ca.crt" >> $GITHUB_ENV
# These files are created by configure-aio
- name: Load client certificates into environment
run: |
if [ ! -f ".session/client.key" ]; then
echo "Missing 'client.key' file"
exit 1
fi
if [ ! -f ".session/client.crt" ]; then
echo "Missing 'client.crt' file"
exit 1
fi
echo "CLIENT_KEY=$(pwd)/.session/client.key" >> $GITHUB_ENV
echo "CLIENT_CERT=$(pwd)/.session/client.crt" >> $GITHUB_ENV
- name: Setup faultable MQTT broker
run: RUNNER_TRACKING_ID="" && dotnet run --project eng/test/faultablemqttbroker/src/Azure.Iot.Operations.FaultableMqttBroker/Azure.Iot.Operations.FaultableMqttBroker.csproj &
- name: Verify Go protocol module
uses: magefile/mage-action@v3
with:
version: latest
args: civerify
workdir: ./go/protocol
- name: Verify Go mqtt module
uses: magefile/mage-action@v3
with:
version: latest
args: civerify
workdir: ./go/mqtt
- name: Verify Go services module
uses: magefile/mage-action@v3
with:
version: latest
args: civerify
workdir: ./go/services
- name: Verify Go protocol tests
uses: magefile/mage-action@v3
with:
version: latest
args: civerify
workdir: ./go/test/protocol
- name: Verify Go integration tests
uses: magefile/mage-action@v3
with:
version: latest
args: civerify
workdir: ./go/test/integration
- name: Build codegen
run: dotnet build codegen/src/Azure.Iot.Operations.ProtocolCompiler/Azure.Iot.Operations.ProtocolCompiler.csproj
- name: Codegen counter for Go
working-directory: ./go/samples/protocol/counter/envoy
run: ./gen.sh
- name: Run counter server
working-directory: ./go/samples/protocol/counter/server
run: go run . &
env:
AIO_BROKER_HOSTNAME: localhost
AIO_BROKER_TCP_PORT: 8884
AIO_TLS_CA_FILE: ${{ env.CA_FILE_PATH }}
AIO_SAT_FILE: ${{ env.TOKEN_FILE_PATH }}
AIO_MQTT_CLIENT_ID: CounterServer-go
- name: Run counter client
working-directory: ./go/samples/protocol/counter/client
run: go run .
env:
AIO_BROKER_HOSTNAME: localhost
AIO_BROKER_TCP_PORT: 8884
AIO_TLS_CA_FILE: ${{ env.CA_FILE_PATH }}
AIO_SAT_FILE: ${{ env.TOKEN_FILE_PATH }}
AIO_MQTT_CLIENT_ID: CounterClient-go
COUNTER_SERVER_ID: CounterServer-go