diff --git a/.github/workflows/mqtt-sn-check.yml b/.github/workflows/mqtt-sn-check.yml index 61b37a679..706d0c929 100644 --- a/.github/workflows/mqtt-sn-check.yml +++ b/.github/workflows/mqtt-sn-check.yml @@ -42,7 +42,8 @@ jobs: run: more gateway.conf - name: Run gateway working-directory: ./gateway/MQTTSNGateway/bin - run: sudo ./MQTT-SNGateway & + run: sudo ./MQTT-SNGateway &> ~/gateway.log & + gateway_pid=$! sleep 1 # let the broker set everything up # This is some debug info useful if something goes wrong @@ -84,6 +85,10 @@ jobs: RESULT=$? [ $RESULT -ne 0 ] && echo -e "\n\nMQTT-SN Client failed!" && exit 1 + # Cleanup + - name: Stop gateway + run: kill -2 $gateway_pid + # capture logs on failure - name: Show logs on failure if: failure() || cancelled()