From 9d6ce8dfacb4e15ed4a2680289bdb4ccb22804f6 Mon Sep 17 00:00:00 2001 From: Peter Buchegger Date: Wed, 17 May 2023 21:19:22 +0200 Subject: [PATCH] update cppcheck --- .github/workflows/build_check.yml | 62 +++++++++---------------------- platformio.ini | 3 +- 2 files changed, 19 insertions(+), 46 deletions(-) diff --git a/.github/workflows/build_check.yml b/.github/workflows/build_check.yml index df4c06c..f3889e2 100644 --- a/.github/workflows/build_check.yml +++ b/.github/workflows/build_check.yml @@ -60,52 +60,26 @@ jobs: cppcheck: name: Run cppcheck runs-on: ubuntu-latest - env: - CPPCHECK_ARGS: --enable=all --std=c++14 --inline-suppr -I lib/BoardFinder -I lib/ConfigurationManagement -I lib/Display -I lib/LoRa -I lib/LoRa_APRS -I lib/NTPClient -I lib/PowerManagement -I lib/System -I lib/TimeLib -i lib/Display -i lib/LoRa -i lib/NTPClient -i lib/TimeLib src lib steps: - - name: checkout code - uses: actions/checkout@v3 - - run: docker pull facthunder/cppcheck:latest - - name: Run cppcheck and print result - run: docker run --rm -v ${PWD}:/src facthunder/cppcheck:latest /bin/bash -c "cppcheck $CPPCHECK_ARGS" - - name: Run cppcheck and create html - run: docker run --rm -v ${PWD}:/src facthunder/cppcheck:latest /bin/bash -c "cppcheck --xml $CPPCHECK_ARGS 2> report.xml && cppcheck-htmlreport --file=report.xml --report-dir=output" - - name: Upload report - uses: actions/upload-artifact@v3 + - uses: actions/cache@v3 with: - name: Cppcheck Report - path: output + path: | + ~/.cache/pip + ~/.platformio/.cache + key: check-cache + - uses: actions/setup-python@v4 + with: + python-version: '3.10' + - name: Install PlatformIO + shell: bash + run: | + python -m pip install --upgrade pip + pip install --upgrade platformio - - #remote_testing: - # name: Remote Testing - # runs-on: ubuntu-20.04 - # env: - # PLATFORMIO_AUTH_TOKEN: ${{ secrets.PLATFORMIO_AUTH_TOKEN }} - # steps: - # - name: Setup Cache - # uses: actions/cache@v3 - # with: - # path: | - # ~/.cache/pip - # ~/.platformio - # key: remote-cache - # - name: Setup Python - # uses: actions/setup-python@v4 - # with: - # python-version: '3.10' - # - name: Install PlatformIO - # shell: bash - # run: | - # python -m pip install --upgrade pip - # pip install --upgrade platformio - # - # - name: Checkout code - # uses: actions/checkout@v3 - # - name: List Devices - # run: pio remote device list - # - name: PlatformIO Test - # run: pio remote test -v -r --upload-port /dev/ttyUSB4 --test-port /dev/ttyUSB4 + - name: Checkout code + uses: actions/checkout@v3 + - name: Run PlatformIO Check + run: pio check --fail-on-defect high -e lora_board hw_testing: name: Hardware Testing @@ -119,7 +93,7 @@ jobs: path: | ~/.cache/pip ~/.platformio/.cache - key: compile-cache + key: hw-cache - uses: actions/setup-python@v4 with: python-version: '3.10' diff --git a/platformio.ini b/platformio.ini index 401fc3b..24d2297 100644 --- a/platformio.ini +++ b/platformio.ini @@ -19,10 +19,9 @@ lib_deps = jgromes/RadioLib @ 5.7.0 check_tool = cppcheck check_flags = - cppcheck: --suppress=*:*.pio\* --inline-suppr -DCPPCHECK --force lib -ilib/TimeLib -ilib/LoRa -ilib/NTPClient + cppcheck: --std=c++14 --suppress=*:*.pio\* --inline-suppr --suppress=unusedFunction -DCPPCHECK --force lib -ilib/TimeLib check_skip_packages = yes test_build_src = yes -#monitor_flags = --raw # activate for OTA Update, use the CALLSIGN from is-cfg.json as upload_port: #upload_protocol = espota #upload_port = .local