2020-12-17 08:07:07 -05:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [master]
|
|
|
|
pull_request:
|
|
|
|
branches: [master]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
linux:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-09-07 06:22:32 -04:00
|
|
|
flavor: [debian, fedora, ubuntu]
|
2020-12-17 08:07:07 -05:00
|
|
|
|
|
|
|
name: Linux
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Run tests
|
|
|
|
run: |
|
|
|
|
docker build -f Dockerfile.${{ matrix.flavor }} -t profanity .
|
|
|
|
docker run profanity ./ci-build.sh
|
|
|
|
|
2022-03-28 10:37:06 -04:00
|
|
|
code-style:
|
2023-04-14 08:03:45 -04:00
|
|
|
runs-on: ubuntu-22.04
|
2022-03-28 10:37:06 -04:00
|
|
|
name: Check coding style
|
|
|
|
continue-on-error: true
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2023-11-06 14:56:48 -05:00
|
|
|
# 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: |
|
|
|
|
[[ "$(find src -type f -name '*.[ch]' -exec awk '/^#define auto_[\W]*/ {print $2}' '{}' \; | sort -u | wc -l)" == "6" ]] || exit -1
|
|
|
|
- name: Check auto types are initialized
|
|
|
|
run: |
|
|
|
|
grep -P 'auto_(char|gchar|gcharv|guchar|jid|sqlite)[\w *]*;$' -r src && exit -1 || true
|
2023-04-14 08:03:45 -04:00
|
|
|
- name: Run clang-format
|
|
|
|
uses: jidicula/clang-format-action@v4.11.0
|
|
|
|
with:
|
|
|
|
clang-format-version: '16'
|
|
|
|
check-path: 'src'
|
2023-04-14 16:18:25 -04:00
|
|
|
|
|
|
|
spell-check:
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
name: Check spelling
|
|
|
|
continue-on-error: true
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: install dependencies
|
|
|
|
run: |
|
|
|
|
sudo apt update
|
|
|
|
sudo apt install -y --no-install-recommends codespell
|
|
|
|
- name: Check spelling
|
|
|
|
run: |
|
|
|
|
codespell
|