use vendored cppcheck from dependencies repo (#2347)

This commit is contained in:
Adeeb Shihadeh
2026-02-23 12:47:39 -08:00
committed by GitHub
parent 49f72e931f
commit 5c1f2578ef
5 changed files with 2 additions and 79 deletions

View File

@@ -66,12 +66,6 @@ jobs:
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Cache cppcheck
id: cppcheck-cache
uses: actions/cache@v4
with:
path: tests/misra/cppcheck
key: cppcheck-${{ hashFiles('tests/misra/*') }}
- run: ./setup.sh
- name: Build FW
run: ${{ env.RUN }} "scons -j$(nproc)"
@@ -84,16 +78,8 @@ jobs:
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Cache cppcheck
id: cppcheck-cache
uses: actions/cache@v4
with:
path: tests/misra/cppcheck
key: cppcheck-${{ hashFiles('tests/misra/*') }}
- run: ./setup.sh
- name: Build FW
run: ${{ env.RUN }} "scons -j$(nproc)"
- name: tests/misra/install.sh
run: ${{ env.RUN }} "cd tests/misra && ./install.sh"
- name: MISRA mutation tests
run: ${{ env.RUN }} "cd tests/misra && pytest test_mutation.py"

View File

@@ -1,41 +0,0 @@
name: Update cppcheck
on:
#push:
schedule:
- cron: "0 14 * * 1" # every Monday at 2am UTC (6am PST)
workflow_dispatch:
jobs:
update-cppcheck:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Get latest cppcheck version
id: version
run: |
# Tags are sorted by time (newest first), so get the first version-like tag
LATEST=$(curl -fsSL "https://api.github.com/repos/danmar/cppcheck/tags?per_page=20" | \
jq -r '.[].name' | \
grep -E '^[0-9]+\.[0-9]+(\.[0-9]+)?$' | \
head -n 1)
echo "vers=$LATEST" >> "$GITHUB_OUTPUT"
- name: Update VERS in install.sh
run: |
sed -i "s/^VERS=\".*\"/VERS=\"${{ steps.version.outputs.vers }}\"/" tests/misra/install.sh
grep VERS tests/misra/install.sh
- name: Create Pull Request
uses: peter-evans/create-pull-request@9153d834b60caba6d51c9b9510b087acf9f33f83
with:
author: Vehicle Researcher <user@comma.ai>
token: ${{ secrets.ACTIONS_CREATE_PR_PAT }}
commit-message: "[bot] Update cppcheck to ${{ steps.version.outputs.vers }}"
title: "[bot] Update cppcheck to ${{ steps.version.outputs.vers }}"
body: "See all cppcheck releases: https://github.com/danmar/cppcheck/releases"
branch: "update-cppcheck"
base: "master"
delete-branch: true
labels: bot

View File

@@ -31,6 +31,7 @@ dev = [
"setuptools",
"spidev; platform_system == 'Linux'",
"gcc-arm-none-eabi @ git+https://github.com/commaai/dependencies.git@releases#subdirectory=gcc-arm-none-eabi",
"cppcheck @ git+https://github.com/commaai/dependencies.git@releases#subdirectory=cppcheck",
]
[build-system]

View File

@@ -1,18 +0,0 @@
#!/usr/bin/env bash
set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
: "${CPPCHECK_DIR:=$DIR/cppcheck/}"
if [ ! -d "$CPPCHECK_DIR" ]; then
git clone https://github.com/danmar/cppcheck.git $CPPCHECK_DIR
fi
cd $CPPCHECK_DIR
VERS="2.16.0"
git fetch --all --tags --force
git checkout $VERS
#make clean
make MATCHCOMPILTER=yes CXXFLAGS="-O2" -j8

View File

@@ -10,12 +10,7 @@ YELLOW="\e[1;33m"
RED="\e[1;31m"
NC='\033[0m'
: "${CPPCHECK_DIR:=$DIR/cppcheck/}"
# install cppcheck if missing
if [ -z "${SKIP_CPPCHECK_INSTALL}" ]; then
$DIR/install.sh
fi
: "${CPPCHECK_DIR:=$(python3 -c "import cppcheck; print(cppcheck.DIR)")}"
# ensure checked in coverage table is up to date
cd $DIR