diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 8693ed9..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,41 +0,0 @@ -version: 2 - -jobs: - build: - docker: - - image: sensirion/embedded-ci:2.4.0 - steps: - - checkout - - run: make test - - style-check: - docker: - - image: sensirion/embedded-ci:2.4.0 - steps: - - checkout - - run: make style-check - - run-cppcheck: - docker: - - image: sensirion/embedded-ci:2.4.0 - steps: - - checkout - - run: cppcheck --std=c89 --language=c --error-exitcode=1 --enable=warning,style,performance,portability -i i2c/sample-implementations/ -i shdlc/sample-implementations/ . - - run-tests: - docker: - - image: sensirion/embedded-ci:2.4.0 - steps: - - checkout - - run: - name: Running tests - command: cd tests && make test - -workflows: - version: 2 - build: - jobs: - - build - - style-check - - run-tests - - run-cppcheck diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..5cdc8ae --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,23 @@ +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 . -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 i2c/sample-implementations/ -i shdlc/sample-implementations/ . .