mirror of
https://github.com/irssi/irssi.git
synced 2024-10-27 05:20:20 -04:00
29 lines
1.0 KiB
YAML
29 lines
1.0 KiB
YAML
on: [pull_request]
|
|
name: clang-format
|
|
jobs:
|
|
check-clang-format:
|
|
runs-on: ubuntu-20.04
|
|
steps:
|
|
- name: install clang-format
|
|
run: sudo apt install clang-format-11
|
|
- uses: actions/checkout@main
|
|
- name: fetch target ref
|
|
run:
|
|
|
|
|
refs=($(git log -1 --format=%s))
|
|
git fetch --depth=1 origin "${refs[3]}"
|
|
- name: configure clang-format
|
|
run:
|
|
|
|
|
git config clangformat.binary $PWD/utils/clang-format-xs/clang-format-xs
|
|
git config clangformat.extensions c,h,xs
|
|
- name: run git-clang-format and Check if no changes are needed
|
|
run:
|
|
|
|
|
CLANG_FORMAT=clang-format-11 git-clang-format-11 --diff FETCH_HEAD HEAD | tee git-clang-format.diff
|
|
cmp -s <(echo no modified files to format) git-clang-format.diff || cmp -s <(echo -n) git-clang-format.diff
|
|
- uses: actions/upload-artifact@v1
|
|
if: failure()
|
|
with:
|
|
name: git-clang-format.diff
|
|
path: git-clang-format.diff |