flipperzero-firmware/.github/workflows/lint_c.yml
Max Andreev 9d728a1c65
Check FL ticket in PR name after merge (#2076)
* Add base
* Add base again
* Test reporting
* Fix reporting
* Fix secrets
* Fix arguments in report
* Remove depricated actions
* Disable reporting on PR

Co-authored-by: あく <alleteam@gmail.com>
2022-12-10 22:10:51 +09:00

46 lines
1.2 KiB
YAML

name: 'Lint C/C++ with clang-format'
on:
push:
branches:
- dev
- "release*"
tags:
- '*'
pull_request:
env:
TARGETS: f7
jobs:
lint_c_cpp:
runs-on: [self-hosted,FlipperZeroShell]
steps:
- name: 'Decontaminate previous build leftovers'
run: |
if [ -d .git ]; then
git submodule status || git checkout "$(git rev-list --max-parents=0 HEAD | tail -n 1)"
fi
- name: 'Checkout code'
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: 'Check code formatting'
id: syntax_check
run: SET_GH_OUTPUT=1 FBT_TOOLCHAIN_PATH=/runner/_work ./fbt lint
- name: Report code formatting errors
if: failure() && steps.syntax_check.outputs.errors && github.event.pull_request
uses: peter-evans/create-or-update-comment@v1
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
Please fix following code formatting errors:
```
${{ steps.syntax_check.outputs.errors }}
```
You might want to run `./fbt format` for an auto-fix.