2022-11-20 08:15:24 +08:00
|
|
|
name: Checks
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
paths-ignore:
|
|
|
|
- '.github/ISSUE_TEMPLATE/**'
|
|
|
|
- 'LICENSE'
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: checks-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
cpp-linter:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2024-07-11 07:52:40 +08:00
|
|
|
- uses: actions/checkout@v4
|
2022-11-20 08:15:24 +08:00
|
|
|
- name: Configure CMake
|
|
|
|
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Debug
|
|
|
|
|
2024-07-11 07:52:40 +08:00
|
|
|
- uses: cpp-linter/cpp-linter-action@v2.12.0
|
2022-11-20 08:15:24 +08:00
|
|
|
id: linter
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
style: file
|
2024-07-11 07:52:40 +08:00
|
|
|
version: '18'
|
2022-11-20 08:15:24 +08:00
|
|
|
database: ${{github.workspace}}/build
|
|
|
|
|
|
|
|
- name: Fail fast?!
|
|
|
|
if: steps.linter.outputs.checks-failed > 0
|
|
|
|
run: |
|
|
|
|
echo "Some files failed the linting checks!"
|
|
|
|
# for actual deployment
|
|
|
|
# run: exit 1
|
|
|
|
|
|
|
|
check_clang_format:
|
|
|
|
name: "Check C++ style"
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2024-07-11 07:52:40 +08:00
|
|
|
- uses: actions/checkout@v4
|
2022-11-20 08:15:24 +08:00
|
|
|
- name: Run clang-format style check for C/C++/Protobuf programs.
|
2024-07-11 07:52:40 +08:00
|
|
|
uses: jidicula/clang-format-action@v4.13.0
|
2022-11-20 08:15:24 +08:00
|
|
|
with:
|
2024-07-11 07:52:40 +08:00
|
|
|
clang-format-version: '18'
|
2022-11-20 08:15:24 +08:00
|
|
|
check-path: 'src'
|
2022-11-20 08:24:16 +08:00
|
|
|
exclude-regex: 'src/subprocess.h'
|
2022-11-20 08:15:24 +08:00
|
|
|
|