Skip to content

Static analysis

Static analysis #13

name: Static Analysis
on:
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake python3-pip jq cppcheck
pip3 install codechecker requests
CodeChecker analyzers --details
- name: generate compile commands
run: bazel build //:iso14229 && bazel run //:lib_compile_commands
- name: Analyze with CodeChecker
run: |
CodeChecker analyze compile_commands.json --ignore .CodeChecker/skipfile.txt -o reports
- name: Print report summary
run: |
CodeChecker parse reports
continue-on-error: true
- name: Generate json report
run: |
CodeChecker parse reports --export json -o report.json
continue-on-error: true
- name: Create Check Run with Annotations
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_SHA: ${{ github.event.pull_request.head.sha }}
GITHUB_REPOSITORY: ${{ github.repository }}
run: |
python3 .CodeChecker/post_to_github.py report.json