Merge pull request 'Fix arch build; update workflow' (#3) from fix-arch-build into master
All checks were successful
CI / Check spelling (push) Successful in 18s
CI / Check coding style (push) Successful in 29s
CI / Linux (ubuntu) (push) Successful in 11m44s
CI / Linux (debian) (push) Successful in 11m46s
CI / Linux (fedora) (push) Successful in 13m16s
CI / Linux (arch) (push) Successful in 14m47s
All checks were successful
CI / Check spelling (push) Successful in 18s
CI / Check coding style (push) Successful in 29s
CI / Linux (ubuntu) (push) Successful in 11m44s
CI / Linux (debian) (push) Successful in 11m46s
CI / Linux (fedora) (push) Successful in 13m16s
CI / Linux (arch) (push) Successful in 14m47s
Reviewed-on: devs/profanity#3
This commit is contained in:
52
.github/workflows/main.yml
vendored
52
.github/workflows/main.yml
vendored
@@ -20,18 +20,20 @@ jobs:
|
||||
|
||||
name: Linux
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v4
|
||||
- name: Run tests
|
||||
run: |
|
||||
docker build -f Dockerfile.${{ matrix.flavor }} -t profanity .
|
||||
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,18 +41,48 @@ 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."
|
||||
else
|
||||
echo "✅ All files are properly formatted."
|
||||
fi
|
||||
exit $failed
|
||||
|
||||
spell-check:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-latest
|
||||
name: Check spelling
|
||||
continue-on-error: true
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v4
|
||||
- name: install dependencies
|
||||
run: |
|
||||
sudo apt update
|
||||
|
||||
@@ -387,7 +387,7 @@ release_get_latest(void)
|
||||
|
||||
curl_easy_setopt(handle, CURLOPT_URL, url);
|
||||
curl_easy_setopt(handle, CURLOPT_WRITEFUNCTION, _data_callback);
|
||||
curl_easy_setopt(handle, CURLOPT_TIMEOUT, 2);
|
||||
curl_easy_setopt(handle, CURLOPT_TIMEOUT, 2L);
|
||||
curl_easy_setopt(handle, CURLOPT_WRITEDATA, (void*)&output);
|
||||
|
||||
curl_easy_perform(handle);
|
||||
|
||||
@@ -656,11 +656,15 @@ p_gpg_decrypt(const char* const cipher)
|
||||
error = gpgme_get_key(ctx, recipient->keyid, &key, 1);
|
||||
|
||||
if (!error && key) {
|
||||
const char* addr = gpgme_key_get_string_attr(key, GPGME_ATTR_EMAIL, NULL, 0);
|
||||
if (addr) {
|
||||
g_string_append(recipients_str, addr);
|
||||
for (gpgme_user_id_t uid = key->uids; uid != NULL; uid = uid->next) {
|
||||
if (uid->email) {
|
||||
g_string_append(recipients_str, uid->email);
|
||||
break;
|
||||
}
|
||||
}
|
||||
gpgme_key_unref(key);
|
||||
} else if (error) {
|
||||
log_warning("GPGME error: %s", gpgme_strerror(error));
|
||||
}
|
||||
|
||||
if (recipient->next) {
|
||||
|
||||
Reference in New Issue
Block a user