Skip to content

Commit

Permalink
Ci/add cpp check (#39)
Browse files Browse the repository at this point in the history
* ci: add cppcheck

Signed-off-by: kminoda <[email protected]>

* ci: add cppcheck (#32)

Signed-off-by: kminoda <[email protected]>

* apply to fixed file

Signed-off-by: kminoda <[email protected]>

* Ci/add cpp check (#34)

* ci: add cppcheck

Signed-off-by: kminoda <[email protected]>

* apply to fixed file

Signed-off-by: kminoda <[email protected]>

---------

Signed-off-by: kminoda <[email protected]>

* fix

Signed-off-by: kminoda <[email protected]>

* Ci/add cpp check (#35)

* ci: add cppcheck

Signed-off-by: kminoda <[email protected]>

* apply to fixed file

Signed-off-by: kminoda <[email protected]>

---------

Signed-off-by: kminoda <[email protected]>

* add rev-list

Signed-off-by: kminoda <[email protected]>

* fix

Signed-off-by: kminoda <[email protected]>

---------

Signed-off-by: kminoda <[email protected]>
  • Loading branch information
kminoda authored Jun 4, 2024
1 parent 19ea101 commit cdf9d99
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/cpp-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: cppcheck

on:
pull_request:

jobs:
cppcheck:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v1

- name: Install Cppcheck
run: sudo apt-get install -y cppcheck

- name: Get changed files
id: changed-files
run: |
git fetch origin ${{ github.base_ref }} --depth=1
git diff --name-only origin/${{ github.base_ref }} ${{ github.head_ref }} > changed_files.txt
cat changed_files.txt
- name: Run Cppcheck on changed files
run: |
files=$(cat changed_files.txt | grep '\.cpp$\|\.h$' | tr '\n' ' ')
if [ -n "$files" ]; then
cppcheck --enable=warning,style,performance --error-exitcode=1 $files
else
echo "No C++ files changed."
shell: bash

0 comments on commit cdf9d99

Please sign in to comment.