Skip to content

Commit

Permalink
actions: add cppcheck and yamllint
Browse files Browse the repository at this point in the history
CI saves lives

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
  • Loading branch information
cujomalainey committed May 4, 2021
1 parent 4586095 commit fc76c97
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/cppcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
# SPDX-License-Identifier: BSD-3-Clause
# Tools that can save round-trips to github and a lot of time:
#
# yamllint -f parsable this.yml
# pip3 install ruamel.yaml.cmd
# yaml merge-expand this.yml exp.yml && diff -w -u this.yml exp.yml
#
# github.com also has a powerful web editor that can be used without
# committing.

name: cppcheck

# yamllint disable-line rule:truthy
on: [pull_request, push]

jobs:
cppcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# From time to time this will catch a git tag and change SOF_VERSION
with: {fetch-depth: 50, submodules: recursive}

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

# TODO enable more types of checks as they become available
- name: run cppcheck
run: cppcheck --platform=unix32 --force --max-configs=1024 --inconclusive --quiet --inline-suppr .
29 changes: 29 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
# SPDX-License-Identifier: BSD-3-Clause
# Tools that can save round-trips to github and a lot of time:
#
# yamllint -f parsable this.yml
# pip3 install ruamel.yaml.cmd
# yaml merge-expand this.yml exp.yml && diff -w -u this.yml exp.yml
#
# github.com also has a powerful web editor that can be used without
# committing.

name: checkpatch

# yamllint disable-line rule:truthy
on: [pull_request]

jobs:
yamllint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# From time to time this will catch a git tag and change SOF_VERSION
with: {fetch-depth: 50, submodules: recursive}

- name: apt install yamllint
run: sudo apt-get -y install yamllint

- name: run yamllint
run: yamllint .github/workflows/*.yml

0 comments on commit fc76c97

Please sign in to comment.