add more options to show text entities #77
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check style | |
on: | |
push: | |
branches-ignore: | |
- gh-readonly-queue/** | |
- master | |
pull_request: | |
merge_group: | |
jobs: | |
check-style: | |
runs-on: ubuntu-latest | |
env: | |
CARGO_HTTP_MULTIPLEXING: false | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Prepare Linux | |
run: | | |
sudo apt-get update -y | |
sudo apt-get install ddnet-tools shellcheck pkg-config cmake ninja-build libfreetype6-dev libnotify-dev libsdl2-dev libsqlite3-dev libavcodec-dev libavformat-dev libavutil-dev libswresample-dev libswscale-dev libx264-dev python3-clang libvulkan-dev glslang-tools spirv-tools libglew-dev -y | |
rustup default stable | |
pip3 install pylint | |
wget https://github.com/muttleyxd/clang-tools-static-binaries/releases/download/master-46b8640/clang-format-10_linux-amd64 | |
echo "b8ed0cfc9cded28f8c0c9dd0da402d1287453b7d55a68bf243b432035aebcaa4720bfff22440d1f1c5d4c82f7b8d85948214cca85a2aa976589b88459e440521 clang-format-10_linux-amd64" | sha512sum -c | |
mv clang-format-10_linux-amd64 ~/.local/bin/clang-format | |
chmod +x ~/.local/bin/clang-format | |
wget -O ~/.local/bin/shfmt https://github.com/mvdan/sh/releases/download/v3.8.0/shfmt_v3.8.0_linux_amd64 | |
chmod +x ~/.local/bin/shfmt | |
- name: Cache Rust dependencies | |
uses: Swatinem/rust-cache@v2 | |
- name: Check code style (ClangFormat) | |
run: | | |
clang-format -version | |
scripts/fix_style.py --dry-run | |
- name: Shellcheck | |
run: find . -type f -name '*.sh' -print0 | xargs -0 shellcheck | |
- name: Shell format (shfmt) | |
run: find . -type f -name '*.sh' -print0 | xargs -0 shfmt -d | |
- name: Pylint | |
run: | | |
pylint --version | |
find . -type f -name "*.py" -not -path './ddnet-libs/*' -not -path './googletest-src/*' -print0 | xargs -0 pylint | |
- name: Check header guards | |
run: scripts/check_header_guards.py | |
- name: Unused header files | |
run: scripts/check_unused_header_files.py | |
- name: Check standard header includes | |
run: scripts/check_standard_headers.sh | |
- name: Check absolute includes | |
run: "! grep --exclude-dir rust-bridge -rE '^#include \"(antibot|base|engine|game|steam|test)/' src/" | |
- name: Check config variables | |
run: scripts/check_config_variables.py | |
- name: Check log error format | |
run: | | |
if grep -Eqr '(msg|Print).*\(.*"[Ee]rror:' src/; | |
then | |
echo "Expected log errors to be in this format 'ERROR: error message'" | |
echo "Found these non uppercased log errors:" | |
grep -Er '(msg|Print).*\(.*"[Ee]rror:' src/ | |
exit 1 | |
fi | |
- name: Validate languages | |
run: scripts/languages/validate.py | |
- name: Check languages | |
run: scripts/languages/update_all.py | |
- name: Build dilate tool | |
run: | | |
mkdir release | |
cd release | |
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DDOWNLOAD_GTEST=OFF -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=. .. | |
cmake --build . --config Release --target dilate | |
- name: Check dilated images | |
run: scripts/check_dilate.py release data | |
- name: Build twmap tool | |
run: | | |
git clone https://gitlab.com/Patiga/twmap.git/ | |
cd twmap/twmap-tools | |
cargo install --locked --path=. | |
cd ../.. | |
rm -rf twmap | |
- name: Check maps | |
run: | | |
findings=$(find data -type f -name '*.map' ! -wholename 'data/maps/coverage.map' -print0 | xargs -0 ~/.cargo/bin/twmap-check-ddnet 2>&1 | \ | |
grep -v -E "\"data/maps/(ctf|dm).*\.map\": Time cps are missing on the map" | \ | |
grep -v -E "\"data/themes/.*\.map\": Time cps are missing on the map" | \ | |
grep -v -E "\"data/maps/ctf4\.map\": Map - In Image at index 3 -> Image 'jungle_doodads_old' is not a valid external image for DDNet06" | \ | |
grep -v -E "\"data/themes/autumn_night\.map\": Map - In Image at index 3 -> Image 'generic_lamps' is not a valid external image for DDNet06" | \ | |
grep -v -E "\"data/maps7?/Tutorial\.map\": Map setting - Unusual: 'sv_show_others_default'" || true) | |
if [ -n "$findings" ]; then | |
echo "$findings" | |
exit 1 | |
fi |