Fix arch build; update workflow #3
52
.github/workflows/main.yml
vendored
52
.github/workflows/main.yml
vendored
@@ -20,18 +20,20 @@ jobs:
|
|||||||
|
|
||||||
name: Linux
|
name: Linux
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: |
|
run: |
|
||||||
docker build -f Dockerfile.${{ matrix.flavor }} -t profanity .
|
docker build -f Dockerfile.${{ matrix.flavor }} -t profanity .
|
||||||
docker run profanity ./ci-build.sh
|
docker run profanity ./ci-build.sh
|
||||||
|
|
||||||
code-style:
|
code-style:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-latest
|
||||||
name: Check coding style
|
name: Check coding style
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
env:
|
||||||
|
GITHUB_WORKSPACE: ${{ runner.workspace }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
# if this check fails, you have to update the number of auto types known and the list of auto types in the check below
|
# if this check fails, you have to update the number of auto types known and the list of auto types in the check below
|
||||||
- name: Check auto types are up-to-date
|
- name: Check auto types are up-to-date
|
||||||
run: |
|
run: |
|
||||||
@@ -39,18 +41,48 @@ jobs:
|
|||||||
- name: Check auto types are initialized
|
- name: Check auto types are initialized
|
||||||
run: |
|
run: |
|
||||||
grep -P 'auto_(char|gchar|gcharv|guchar|jid|sqlite|gfd|FILE)[\w *]*;$' -r src && exit -1 || true
|
grep -P 'auto_(char|gchar|gcharv|guchar|jid|sqlite|gfd|FILE)[\w *]*;$' -r src && exit -1 || true
|
||||||
- name: Run clang-format
|
|
||||||
uses: jidicula/clang-format-action@v4.11.0
|
- name: Install clang-format
|
||||||
with:
|
run: |
|
||||||
clang-format-version: '16'
|
sudo apt-get update
|
||||||
check-path: 'src'
|
sudo apt-get install -y clang-format
|
||||||
|
|
||||||
|
- name: Run clang-format check
|
||||||
|
run: |
|
||||||
|
echo $(clang-format --version)
|
||||||
|
# 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)
|
||||||
|
if [ -z "$files" ]; then
|
||||||
|
echo "✅ No source files found to check."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Run clang-format in dry-run mode and collect any improperly formatted files
|
||||||
|
failed=0
|
||||||
|
for file in $files; do
|
||||||
|
if ! output=$(clang-format --dry-run --Werror --style=file "$file" 2>&1); then
|
||||||
|
echo "❌ Failed on file: $file"
|
||||||
|
echo "$output"
|
||||||
|
echo "----------------------------------------"
|
||||||
|
failed=1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ $failed -ne 0 ]; then
|
||||||
|
echo "🚫 One or more files are not properly formatted."
|
||||||
|
else
|
||||||
|
echo "✅ All files are properly formatted."
|
||||||
|
fi
|
||||||
|
exit $failed
|
||||||
|
|
||||||
spell-check:
|
spell-check:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-latest
|
||||||
name: Check spelling
|
name: Check spelling
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
- name: install dependencies
|
- name: install dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt update
|
sudo apt update
|
||||||
|
|||||||
Reference in New Issue
Block a user