2020-06-08 04:08:22 -05:00
|
|
|
name: clang-format
|
|
|
|
|
2020-11-19 01:17:55 -06:00
|
|
|
on: [push]
|
2020-06-08 04:08:22 -05:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
clang-format-job:
|
2023-04-13 00:05:53 -05:00
|
|
|
runs-on: ubuntu-22.04
|
2020-06-08 04:08:22 -05:00
|
|
|
steps:
|
2023-02-07 00:22:57 -06:00
|
|
|
- name: Set apt mirror
|
|
|
|
# GitHub Actions apt proxy is super unstable
|
|
|
|
# see https://github.com/actions/runner-images/issues/7048
|
|
|
|
run: |
|
|
|
|
# make sure there is a `\t` between URL and `priority:*` attributes
|
|
|
|
printf 'http://azure.archive.ubuntu.com/ubuntu priority:1\n' | sudo tee /etc/apt/mirrors.txt
|
|
|
|
curl http://mirrors.ubuntu.com/mirrors.txt | sudo tee --append /etc/apt/mirrors.txt
|
|
|
|
sudo sed -i 's/http:\/\/azure.archive.ubuntu.com\/ubuntu\//mirror+file:\/etc\/apt\/mirrors.txt/' /etc/apt/sources.list
|
|
|
|
|
2023-04-13 00:05:53 -05:00
|
|
|
- name: Install clang-format 15.0
|
2022-10-13 08:22:51 -05:00
|
|
|
run: |
|
2023-04-13 00:05:53 -05:00
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install --option="APT::Acquire::Retries=3" clang-format-15
|
|
|
|
clang-format-15 --version
|
2022-10-13 08:22:51 -05:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Check format - ApplicationLibCode
|
|
|
|
run: |
|
|
|
|
cd ApplicationLibCode
|
2023-04-13 00:05:53 -05:00
|
|
|
find -name '*.h' -o -name '*.cpp' -o -name '*.inl' | xargs clang-format-15 -i
|
2022-10-13 08:22:51 -05:00
|
|
|
git diff
|
|
|
|
- name: Check format - ApplicationExeCode
|
|
|
|
run: |
|
|
|
|
cd ApplicationExeCode
|
2023-04-13 00:05:53 -05:00
|
|
|
find -name '*.h' -o -name '*.cpp' -o -name '*.inl' | xargs clang-format-15 -i
|
2022-10-13 08:22:51 -05:00
|
|
|
git diff
|
|
|
|
- name: Check format - AppFwk
|
|
|
|
run: |
|
|
|
|
cd Fwk/AppFwk
|
2023-04-13 00:05:53 -05:00
|
|
|
find -name '*.h' -o -name '*.cpp' -o -name '*.inl' | grep -v gtest | xargs clang-format-15 -i
|
2022-10-13 08:22:51 -05:00
|
|
|
git diff
|
2023-05-18 14:21:33 -05:00
|
|
|
- uses: peter-evans/create-pull-request@v5
|
2022-10-13 08:22:51 -05:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
commit-message: "Fixes by clang-format"
|
|
|
|
title: "Fixes by clang-format"
|
|
|
|
branch: clang-format-patches
|
|
|
|
branch-suffix: random
|