Fix workflow
Some checks failed
CI / Linux (debian) (pull_request) Has been cancelled
CI / Linux (fedora) (pull_request) Has been cancelled
CI / Linux (ubuntu) (pull_request) Has been cancelled
CI / Check spelling (pull_request) Has been cancelled
CI / Linux (arch) (pull_request) Has been cancelled
CI / Check coding style (pull_request) Failing after 29s
Some checks failed
CI / Linux (debian) (pull_request) Has been cancelled
CI / Linux (fedora) (pull_request) Has been cancelled
CI / Linux (ubuntu) (pull_request) Has been cancelled
CI / Check spelling (pull_request) Has been cancelled
CI / Linux (arch) (pull_request) Has been cancelled
CI / Check coding style (pull_request) Failing after 29s
This commit is contained in:
46
.github/workflows/main.yml
vendored
46
.github/workflows/main.yml
vendored
@@ -27,11 +27,13 @@ jobs:
|
||||
docker run profanity ./ci-build.sh
|
||||
|
||||
code-style:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-latest
|
||||
name: Check coding style
|
||||
continue-on-error: true
|
||||
env:
|
||||
GITHUB_WORKSPACE: ${{ runner.workspace }}
|
||||
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
|
||||
- name: Check auto types are up-to-date
|
||||
run: |
|
||||
@@ -39,11 +41,41 @@ 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: Run clang-format
|
||||
uses: jidicula/clang-format-action@v4.11.0
|
||||
with:
|
||||
clang-format-version: '16'
|
||||
check-path: 'src'
|
||||
|
||||
- name: Install clang-format
|
||||
run: |
|
||||
sudo apt-get update
|
||||
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."
|
||||
exit $failed
|
||||
else
|
||||
echo "✅ All files are properly formatted."
|
||||
fi
|
||||
|
||||
spell-check:
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
@@ -668,7 +668,7 @@ p_gpg_decrypt(const char* const cipher)
|
||||
}
|
||||
|
||||
if (recipient->next) {
|
||||
g_string_append(recipients_str, ", ");
|
||||
g_string_append(recipients_str, ", ");
|
||||
}
|
||||
|
||||
recipient = recipient->next;
|
||||
|
||||
Reference in New Issue
Block a user