53 lines
1.4 KiB
YAML
53 lines
1.4 KiB
YAML
|
|
name: "Run static check on repository"
|
|
on:
|
|
push:
|
|
branches: ["master"]
|
|
|
|
jobs:
|
|
static-check:
|
|
runs-on: "ubuntu-latest"
|
|
steps:
|
|
- name: "Update package cache"
|
|
run: "sudo apt-get update"
|
|
|
|
- name: "Setup dependencies"
|
|
run: "sudo apt-get -y install build-essential cmake clang clang-tidy libmosquitto-dev libconfig-dev libgpiod-dev libiio-dev"
|
|
env:
|
|
DEBIAN_FRONTEND: "noninteractive"
|
|
|
|
- name: "Install CodeChecker"
|
|
run: "sudo snap install codechecker --classic"
|
|
|
|
- name: "Checkout repository"
|
|
uses: "actions/checkout@v2"
|
|
with:
|
|
submodules: "true"
|
|
|
|
- name: "Create build directory"
|
|
run: "mkdir build"
|
|
|
|
- name: "Configure cmake"
|
|
run: "cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=yes .."
|
|
working-directory: "build"
|
|
|
|
- name: "Run CodeChecker"
|
|
run: "codechecker analyze compile_commands.json -o results -i ../.codechecker-skip.txt --ctu"
|
|
working-directory: "build"
|
|
|
|
- name: "Generate HTML reports"
|
|
run: "codechecker parse -e html ./results -o ./report"
|
|
working-directory: "build"
|
|
|
|
- name: "Dump report to stderr"
|
|
run: "codechecker parse --print-steps ./results"
|
|
working-directory: "build"
|
|
|
|
- name: "Save HTML reports to artifact"
|
|
uses: "actions/upload-artifact@v2"
|
|
if: ${{ failure() }}
|
|
with:
|
|
name: ${{ format('sa-report-{0}', env.GITHUB_SHA) }}
|
|
path: "build/report"
|
|
retention-days: 30
|