Skip to content

Commit aa0cd7b

Browse files
committed
Fix clang-format github action
Move off of broken clang-format action by implementing our own format check
1 parent 09a024d commit aa0cd7b

1 file changed

Lines changed: 16 additions & 24 deletions

File tree

.github/workflows/format.yml

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,7 @@
1-
# Copyright (c) 2023 Valve Corporation
2-
# Copyright (c) 2023 LunarG, Inc.
1+
# Copyright 2026 Valve Corporation
2+
# Copyright 2026 LunarG, Inc.
33
#
4-
# Licensed under the Apache License, Version 2.0 (the "License");
5-
# you may not use this file except in compliance with the License.
6-
# You may obtain a copy of the License at
7-
#
8-
# http://www.apache.org/licenses/LICENSE-2.0
9-
#
10-
# Unless required by applicable law or agreed to in writing, software
11-
# distributed under the License is distributed on an "AS IS" BASIS,
12-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
# See the License for the specific language governing permissions and
14-
# limitations under the License.
4+
# SPDX-License-Identifier: Apache-2.0
155

166
name: format
177

@@ -28,16 +18,18 @@ jobs:
2818
clang-format:
2919
name: clang-format
3020
runs-on: ubuntu-latest
31-
strategy:
32-
fail-fast: false
33-
matrix:
34-
path:
35-
- 'loader'
36-
- 'tests'
21+
22+
env:
23+
CLANG_FORMAT_VERSION: 16
24+
CLANG_FORMAT_FILES: "*.c *.h *.cpp *.hpp"
25+
3726
steps:
3827
- uses: actions/checkout@v6.0.2
39-
- name: Run clang-format
40-
uses: jidicula/clang-format-action@v4.16.0
41-
with:
42-
clang-format-version: '16'
43-
check-path: ${{ matrix.path }}
28+
- name: Check formatting
29+
run: |
30+
for f in $(git ls-files -- ${CLANG_FORMAT_FILES}); do
31+
echo "Checking $f"
32+
clang-format-${CLANG_FORMAT_VERSION} -i --Werror "$f"
33+
done
34+
35+
git diff --exit-code

0 commit comments

Comments
 (0)