Compare commits
1 Commits
2bd56d35c0
...
2385d358dd
| Author | SHA1 | Date | |
|---|---|---|---|
|
2385d358dd
|
43
.github/workflows/main.yml
vendored
43
.github/workflows/main.yml
vendored
@@ -41,25 +41,34 @@ jobs:
|
||||
- name: Check auto types are initialized
|
||||
run: |
|
||||
grep -P 'auto_(char|gchar|gcharv|guchar|jid|sqlite|gfd|FILE)[\w *]*;$' -r src && exit -1 || true
|
||||
- name: Show workspace dir
|
||||
|
||||
- name: Install clang-format
|
||||
run: |
|
||||
echo "PWD: $(pwd)"
|
||||
echo "GITHUB_WORKSPACE: ${{ github.workspace }}"
|
||||
echo "env GITHUB_WORKSPACE: $GITHUB_WORKSPACE"
|
||||
ls -l
|
||||
ls -l src || echo "src directory not found"
|
||||
- name: Run clang-format
|
||||
uses: jidicula/clang-format-action@v4.15.0
|
||||
with:
|
||||
clang-format-version: '20'
|
||||
check-path: 'src'
|
||||
- name: Show workspace dir after
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y clang-format
|
||||
|
||||
- name: Run clang-format check
|
||||
run: |
|
||||
echo "PWD: $(pwd)"
|
||||
echo "GITHUB_WORKSPACE: ${{ github.workspace }}"
|
||||
echo "env GITHUB_WORKSPACE: $GITHUB_WORKSPACE"
|
||||
ls -l
|
||||
ls -l src || echo "src directory not found"
|
||||
# Find all source files you care about
|
||||
INCLUDE_REGEX='^.*\.((((c|C)(c|pp|xx|\+\+)?$)|((h|H)h?(pp|xx|\+\+)?$))|(ino|pde|proto|cu))$'
|
||||
CHECK_PATH='src'
|
||||
files=$(find "$CHECK_PATH" -name .git -prune -o -regextype posix-egrep -regex "$INCLUDE_REGEX" -print
|
||||
|
||||
# Run clang-format in dry-run mode and collect any improperly formatted files
|
||||
failed=0
|
||||
for file in $files; do
|
||||
output=$(clang-format --dry-run --Werror --style=file "$file" 2>&1)
|
||||
status=$?
|
||||
if [ $status -ne 0 ]; then
|
||||
echo "❌ Failed on file: $file"
|
||||
echo "$output"
|
||||
echo "----------------------------------------"
|
||||
failed=1
|
||||
fi
|
||||
done
|
||||
|
||||
# Exit with 1 if any formatting issues were found
|
||||
exit $failed
|
||||
|
||||
spell-check:
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
Reference in New Issue
Block a user