SystemAgent/.github/workflows/cppcheck.yaml

53 lines
1.4 KiB
YAML
Raw Normal View History

2021-07-27 05:22:39 +00:00
2021-07-27 07:11:13 +00:00
name: "Run static check on repository"
2021-07-27 05:22:39 +00:00
on:
push:
branches: ["master"]
jobs:
2021-07-27 07:11:13 +00:00
static-check:
2021-07-27 05:22:39 +00:00
runs-on: "ubuntu-latest"
steps:
- name: "Update package cache"
run: "sudo apt-get update"
2021-07-27 07:11:13 +00:00
2021-07-27 05:22:39 +00:00
- name: "Setup dependencies"
2021-07-27 07:11:13 +00:00
run: "sudo apt-get -y install build-essential cmake libmosquitto-dev libconfig-dev libgpiod-dev libiio-dev"
2021-07-27 05:22:39 +00:00
env:
DEBIAN_FRONTEND: "noninteractive"
2021-07-27 07:11:13 +00:00
- name: "Install CodeChecker"
run: "sudo snap install codechecker --classic"
2021-07-27 05:22:39 +00:00
- name: "Checkout repository"
uses: "actions/checkout@v2"
with:
submodules: "true"
2021-07-27 07:11:13 +00:00
2021-07-27 05:22:39 +00:00
- name: "Create build directory"
run: "mkdir build"
2021-07-27 07:11:13 +00:00
2021-07-27 05:22:39 +00:00
- name: "Configure cmake"
run: "cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=yes .."
working-directory: "build"
2021-07-27 07:11:13 +00:00
- name: "Run CodeChecker"
run: "codechecker analyze compile_commands.json -o results --ignore ../.codechecker-skip.txt"
2021-07-27 05:22:39 +00:00
working-directory: "build"
2021-07-27 07:11:13 +00:00
- name: "Generate HTML reports"
run: "codechecker parse -e html ./results -o ./report"
working-directory: "build"
- name: "Save HTML reports to artifact"
uses: "actions/upload-artifact@v2"
with:
name: "static-check-report"
path: "build/report"
retion-days: 30
- name: "Dump report to stderr"
run: "codechecker parse --print-steps ./results"
working-directory: "build"