From 9ef9aff52a2c00bf0ea0883fb7a8d147e86bdfd8 Mon Sep 17 00:00:00 2001 From: Peter Buchegger Date: Sat, 15 May 2021 22:19:17 +0200 Subject: [PATCH] add cppcheck --- .github/workflows/build_check.yml | 42 ++++++++++++++++--------------- .gitignore | 2 ++ 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build_check.yml b/.github/workflows/build_check.yml index 5bd16a3..69e1efa 100644 --- a/.github/workflows/build_check.yml +++ b/.github/workflows/build_check.yml @@ -30,7 +30,8 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - name: Checkout code + uses: actions/checkout@v2 - name: Cache pip uses: actions/cache@v2 with: @@ -50,7 +51,8 @@ jobs: pip install --upgrade platformio - name: Run PlatformIO CI run: platformio run - - uses: actions/upload-artifact@v2 + - name: Upload artifacts + uses: actions/upload-artifact@v2 with: name: firmware path: .pio/build/lora_board/firmware.bin @@ -72,27 +74,27 @@ jobs: - 'lib/System' #- 'lib/TimeLib' steps: - - uses: actions/checkout@v2 + - name: Checkout code + uses: actions/checkout@v2 - name: Run clang-format style check for C/C++ programs. uses: jidicula/clang-format-action@v3.2.0 with: clang-format-version: '11' check-path: ${{ matrix.path }} -# cppcheck: -# name: Run Cppcheck -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v2 -# - name: Run Cppcheck -# uses: Bedzior/cppcheck-action -# with: -# enabled checks: all -# enable inconclusive: true -# generate report: true -# - name: Upload report -# uses: actions/upload-artifact@v1 -# with: -# name: report -# path: output - + cppcheck: + name: Run Cppcheck + runs-on: ubuntu-latest + steps: + - name: checkout code + uses: actions/checkout@v2 + - run: docker pull facthunder/cppcheck:latest + - name: Run Cppcheck + run: docker run --rm -v ${PWD}:/src facthunder/cppcheck:latest cppcheck -v --xml --enable=all . 2> report.xml + - name: Generate HTML report + run: docker run --rm -v ${PWD}:/src facthunder/cppcheck:latest cppcheck-htmlreport --file=report.xml --report-dir=output + - name: Upload report + uses: actions/upload-artifact@v1 + with: + name: Cppcheck Report + path: output diff --git a/.gitignore b/.gitignore index 89cc49c..9f19284 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,5 @@ .vscode/c_cpp_properties.json .vscode/launch.json .vscode/ipch +report.xml +output