Skip to content

Commit 0097bc1

Browse files
committed
Update testing workflow
1 parent 8ffdfb6 commit 0097bc1

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

.github/workflows/test.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,12 @@ jobs:
4545
curl -Os https://uploader.codecov.io/latest/linux/codecov
4646
chmod +x codecov
4747
./codecov -t ${CODECOV_TOKEN}
48-
- if: github.ref == 'refs/heads/main'
49-
name: Test hooks
48+
- name: Test hooks
5049
run: |
5150
pip install pre-commit
5251
pre-commit install
53-
pre-commit try-repo .
52+
pre-commit try-repo . -c testing/.pre-commit-config.yaml --files testing/main.c | tee result.txt || true
53+
grep -e "Failed" result.txt
54+
if [ $? -ne 0 ]; then
55+
exit 1
56+
fi

testing/.pre-commit-config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
repos:
2+
- repo: https://github.com/cpp-linter/cpp-linter-hooks
3+
rev:
4+
hooks:
5+
- id: clang-format
6+
args: [--style=file] # to load .clang-format
7+
- id: clang-tidy
8+
args: [--checks=.clang-tidy] # path/to/.clang-tidy

0 commit comments

Comments
 (0)