Skip to content

Commit

Permalink
ci: simplify git ls-files (GoogleCloudPlatform#373)
Browse files Browse the repository at this point in the history
* ci: simplify `git ls-files`

* Ooops, missed -z
  • Loading branch information
coryan committed Jul 5, 2023
1 parent 4059977 commit 359397c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/style.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ jobs:
-DCMAKE_TOOLCHAIN_FILE="${{runner.temp}}/vcpkg/scripts/buildsystems/vcpkg.cmake"
- name: tidy
run: >
git ls-files -z |
grep -zE '\.cc$' |
git ls-files -z -- '*.cc' |
xargs --verbose -P 2 -n 1 -0 clang-tidy-14 -p="${{runner.temp}}/build"
werror-build:
Expand Down Expand Up @@ -103,7 +102,9 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: clang-format
run: git ls-files -z | grep -zE '\.(cc|h)$' | xargs -P 2 -n 50 -0 clang-format-14 -i
run: >
git ls-files -z -- '*.h' '*.cc' |
xargs -P 2 -n 50 -0 clang-format-14 -i
- name: check-diff
run: git diff --ignore-submodules=all --color --exit-code .

Expand All @@ -116,7 +117,7 @@ jobs:
run: pip install cmakelang==0.6.13
- name: cmake-format
run: >
git ls-files -z | grep -zE '((^|/)CMakeLists\.txt|\.cmake)$' |
git ls-files -z -- '*.cmake' '**/CMakeLists.txt' ./CMakeLists.txt |
xargs -P 2 -n 1 -0 /home/runner/.local/bin/cmake-format -i
- name: check-diff
run: git diff --ignore-submodules=all --color --exit-code .
Expand Down

0 comments on commit 359397c

Please sign in to comment.