Skip to content

Migrate to GitHub workflow #1

Migrate to GitHub workflow

Migrate to GitHub workflow #1

Workflow file for this run

name: syntax, static code analyis and build check for c drivers
on:
pull_request:
branches:
- master
push:
branches:
- master
jobs:
code-analysis:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: awalsh128/cache-apt-pkgs-action@v1
with:
packages: cppcheck clang-format
version: 1.0
- name: clang-format syntax-check
run: |
find sht-common -type f -iregex ".*\.\(c\|h\|cpp\|ino\)" -exec clang-format -i -style=file {} \;
find shtc1 -type f -iregex ".*\.\(c\|h\|cpp\|ino\)" -exec clang-format -i -style=file {} \;
find sht3x -type f -iregex ".*\.\(c\|h\|cpp\|ino\)" -exec clang-format -i -style=file {} \;
find sht4x -type f -iregex ".*\.\(c\|h\|cpp\|ino\)" -exec clang-format -i -style=file {} \;
git diff --exit-code
- name: cppcheck static code analyis
run: cppcheck --std=c89 --language=c --error-exitcode=1 --enable=warning,style,performance,portability --suppress=unreadVariable -i sample-projects/ -i embedded-common/ -i release/ .