mirror of
https://github.com/OpenBluetoothToolbox/SimpleBLE
synced 2025-05-08 21:47:10 +08:00
48 lines
1.4 KiB
YAML
48 lines
1.4 KiB
YAML
name: CI Lint
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
workflow_call: # This allows it to be called from ci_main.yml
|
|
|
|
jobs:
|
|
clang-format:
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
|
- name: Clone Repository
|
|
uses: actions/checkout@v4
|
|
- name: Run clang-format
|
|
uses: DoozyX/clang-format-lint-action@v0.14
|
|
with:
|
|
source: '.'
|
|
exclude: './simplepyble'
|
|
extensions: 'h,hpp,cpp,c'
|
|
clangFormatVersion: 14
|
|
inplace: False
|
|
|
|
cppcheck:
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
|
- name: Clone Repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install CppCheck
|
|
run: |
|
|
sudo -H apt-get update -y
|
|
sudo -H apt-get install -y cppcheck
|
|
env:
|
|
DEBIAN_FRONTEND: noninteractive
|
|
- name: Run Cppcheck
|
|
# TODO: Fix the suppressed files.
|
|
run: cppcheck --suppress=objectIndex:simpleble/src/backends/windows/Utils.cpp --suppress=objectIndex:simpledroidble/simpledroidble/src/main/cpp/simpleble_android.cpp --std=c++17 --error-exitcode=1 --xml --xml-version=2 --force . 2>cppcheck_res.xml
|
|
- name: Generate Report
|
|
if: ${{ failure() }}
|
|
run: cppcheck-htmlreport --title=SimpleBLE --file=cppcheck_res.xml --report-dir=report
|
|
- name: Upload Report
|
|
if: ${{ failure() }}
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: report
|
|
path: report
|