Skip to content

Commit

Permalink
make use of cppcheck in ci pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-mohr committed Oct 13, 2023
1 parent 3d80786 commit d0c3f52
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/github-actions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@ jobs:
# https://github.com/pre-commit/action
- uses: pre-commit/[email protected]

cppcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: install dependencies
run: |
apt-get update
apt-get install cppcheck
- name: run cppcheck
run: cppcheck --suppress="*:test/*" --enable=warning,portability,information --error-exitcode=1 --language=c++ $(find -iname "*.ino") $(find -iname "*.cpp") $(find -iname "*.h")

arduino-lint:
runs-on: ubuntu-latest
steps:
Expand Down
11 changes: 11 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,17 @@ pre-commit:
- pre-commit --version
- pre-commit run --all-files

cppcheck:
stage: check_coding_style
image:
# https://hub.docker.com/_/alpine
name: alpine:latest
script:
- date
# install necessary packages:
- apk add --no-cache cppcheck
- cppcheck --suppress="*:test/*" --enable=warning,portability,information --error-exitcode=1 --language=c++ $(find -iname "*.ino") $(find -iname "*.cpp") $(find -iname "*.h")

arduino-lint:
stage: check_coding_style
image:
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.5.0
hooks:
# https://pre-commit.com/hooks.html
- id: check-added-large-files
Expand All @@ -14,6 +14,6 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.32.2
rev: v0.37.0
hooks:
- id: markdownlint

0 comments on commit d0c3f52

Please sign in to comment.