File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Run code linter
2+
3+ on : [push, pull_request]
4+
5+ # Cancel any preceding run on the pull request.
6+ concurrency :
7+ group : lint-test-${{ github.event.pull_request.number || github.ref }}
8+ cancel-in-progress : ${{ github.ref != 'refs/heads/criu-dev' }}
9+
10+ jobs :
11+ lint :
12+ runs-on : ubuntu-latest
13+ container :
14+ image : registry.fedoraproject.org/fedora:latest
15+ steps :
16+ - name : Install tools
17+ run : sudo dnf -y install git make clang-tools-extra which git-clang-format
18+
19+ - uses : actions/checkout@v4
20+
21+ - name : Set git safe directory
22+ # https://github.com/actions/checkout/issues/760
23+ run : git config --global --add safe.directory "$GITHUB_WORKSPACE"
24+
25+ - name : Run make indent
26+ run : |
27+ if [ -z "${{github.base_ref}}" ]; then
28+ git fetch --deepen=1
29+ git clang-format --diff --style file --extensions c,h "HEAD~1"
30+ else
31+ git fetch origin ${{github.base_ref}}
32+ git clang-format --diff --style file --extensions c,h origin/${{github.base_ref}}
33+ fi
You can’t perform that action at this time.
0 commit comments