name: cppcheck

on: [push, pull_request]

concurrency:
  group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
  cancel-in-progress: true

permissions:
  contents: read

jobs:

  cppcheck_2004:
    runs-on: ubuntu-latest
    if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
    steps:
      - name: Checkout
        uses: actions/checkout@v5

      - name: Run cppcheck test
        run: |
            docker run \
            -e WORK_DIR="$PWD" \
            -v $PWD:$PWD ubuntu:24.04 $PWD/scripts/cppcheck.sh
