2020-09-10 02:06:46 +00:00
|
|
|
name: Check style
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches-ignore:
|
|
|
|
- master
|
|
|
|
- staging.tmp
|
|
|
|
- trying.tmp
|
|
|
|
- staging-squash-merge.tmp
|
|
|
|
pull_request:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
check-style:
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2020-09-10 22:00:33 +00:00
|
|
|
with:
|
|
|
|
submodules: true
|
|
|
|
- name: Prepare
|
2020-09-10 02:06:46 +00:00
|
|
|
run: |
|
|
|
|
sudo apt-get update -y
|
2022-02-14 21:34:43 +00:00
|
|
|
sudo apt-get install clang-format imagemagick ddnet-tools shellcheck pkg-config cmake ninja-build libfreetype6-dev libnotify-dev libsdl2-dev libsqlite3-dev pylint3 python3-clang -y
|
2020-09-10 22:00:33 +00:00
|
|
|
mkdir release
|
|
|
|
cd release
|
2022-02-14 21:34:43 +00:00
|
|
|
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DDOWNLOAD_GTEST=OFF -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=. ..
|
|
|
|
cmake --build . --config Release --target dilate
|
2020-12-02 14:08:24 +00:00
|
|
|
- name: Check clang-format
|
|
|
|
run: clang-format -version
|
|
|
|
- name: Check fix_style
|
|
|
|
run: scripts/fix_style.py --dry-run
|
|
|
|
- name: Check header guards
|
|
|
|
run: scripts/check_header_guards.py
|
|
|
|
- name: Check languages
|
|
|
|
run: scripts/languages/update_all.py
|
|
|
|
- name: Check dilated images
|
|
|
|
run: scripts/check_dilate.sh release data
|
2020-12-02 13:56:12 +00:00
|
|
|
- name: Shellcheck
|
2020-12-02 14:22:26 +00:00
|
|
|
run: find . -type f -name '*.sh' -print0 | xargs -0 shellcheck
|
2021-08-03 14:14:54 +00:00
|
|
|
- name: Check log error case
|
|
|
|
run: |
|
|
|
|
if grep -Eqr '(msg|Print).*\(.*"[Ee]rror:' src/;
|
|
|
|
then
|
2021-08-21 09:49:28 +00:00
|
|
|
echo "Expected log errors to be in this format 'ERROR: error message'"
|
|
|
|
echo "Found these non uppercased log errors:"
|
2021-08-03 14:14:54 +00:00
|
|
|
grep -Er '(msg|Print).*\(.*"[Ee]rror:' src/
|
|
|
|
exit 1
|
|
|
|
fi
|
2020-12-02 14:22:26 +00:00
|
|
|
- name: Pylint
|
|
|
|
run: |
|
|
|
|
pylint --version
|
|
|
|
find . -type f -name "*.py" -print0 | xargs -0 pylint
|