fix(mqtt): fix mem leak for rx_handler string #8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: github-action-on-push | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - dev | |
| jobs: | |
| cog-check-job: | |
| runs-on: ubuntu-latest | |
| name: check conventional commit compliance | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Conventional commit check | |
| uses: cocogitto/cocogitto-action@v3 | |
| build: | |
| runs-on: ubuntu-latest | |
| needs: cog-check-job | |
| env: | |
| BUILD_WRAPPER_OUT_DIR: build_wrapper_out | |
| CODECOV_TOKEN: 6ebd0835-7ade-4a08-acaf-3a5291ec8876 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install umINK dependencies | |
| run: | | |
| sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| gcc-13 \ | |
| gperf \ | |
| libmosquitto-dev \ | |
| mosquitto-dev \ | |
| mosquitto \ | |
| mosquitto-clients \ | |
| libpaho-mqtt-dev \ | |
| liblua5.3-dev \ | |
| libjson-c-dev \ | |
| libcmocka-dev \ | |
| libasan5 \ | |
| iproute2 \ | |
| cmake \ | |
| libxml2-utils \ | |
| libjansson-dev \ | |
| uuid-dev | |
| sudo ln -s /usr/lib/x86_64-linux-gnu/pkgconfig/lua-5.3.pc \ | |
| /usr/lib/x86_64-linux-gnu/pkgconfig/lua.pc | |
| pip3 install 'gcovr == 6' | |
| sudo apt-get remove -y gcc-11 | |
| - name: libubox | |
| run: | | |
| git clone https://github.com/openwrt/libubox.git | |
| cd libubox && mkdir build && cd build | |
| CC=gcc-13 cmake -DBUILD_LUA=off .. && sudo make install | |
| - name: ubus | |
| run: | | |
| git clone https://github.com/openwrt/ubus.git | |
| cd ubus && mkdir ubus && cd ubus | |
| CC=gcc-13 cmake -DBUILD_LUA=off .. | |
| sudo make install | |
| - name: libjwt | |
| run: | | |
| git clone https://github.com/benmcollins/libjwt | |
| cd libjwt | |
| git checkout v2.1.1 | |
| mkdir build && cd build | |
| CC=gcc-13 CFLAGS="-DHAVE_OPENSSL" cmake -DBUILD_SHARED_LIBS=1 .. | |
| sudo make install | |
| - name: mosquitto | |
| run: | | |
| mosquitto_passwd -c -b /tmp/pwdfile user password | |
| cp /etc/mosquitto/mosquitto.conf /tmp | |
| echo "password_file /tmp/pwdfile" >> /tmp/mosquitto.conf | |
| echo "allow_anonymous false" >> /tmp/mosquitto.conf | |
| echo "listener 1883" >> /tmp/mosquitto.conf | |
| echo "protocol mqtt" >> /tmp/mosquitto.conf | |
| mosquitto -c /tmp/mosquitto.conf -v -d | |
| mosquitto_pub -h 127.0.0.1 -t "mink/DEBUG_UUID/1/cmd" -m test_payload -u user -P password -r | |
| - name: run unit tests | |
| run: | | |
| export ASAN_OPTIONS=verify_asan_link_order=0 | |
| export CC=gcc-13 | |
| ./autogen.sh | |
| ./configure --enable-mqtt \ | |
| --enable-mosquitto-auth \ | |
| --enable-openwrt | |
| rm -f /tmp/tmp_file_uuid | |
| bash ./test/test_bin_upload.sh & | |
| sudo LD_LIBRARY_PATH=/usr/local/lib /usr/local/sbin/ubusd & | |
| sudo LD_LIBRARY_PATH=/usr/local/lib CC=gcc-13 make check | |
| - name: generate coverage data | |
| run: | | |
| mkdir coverage-dir | |
| sudo rm /usr/bin/gcov | |
| sudo ln -s /usr/bin/gcov-13 /usr/bin/gcov | |
| gcovr --xml-pretty -o coverage-dir/coverage.xml -r . | |
| - name: upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| token: ${{ env.CODECOV_TOKEN }} | |
| files: coverage-dir/coverage.xml | |
| fail_ci_if_error: true |