added cl_antiping_shadow #143
This file contains hidden or 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: recursive | |
| - name: Prepare Linux | |
| run: | | |
| sudo apt-get update -y | |
| sudo apt-get install ddnet-tools shellcheck tidy pkg-config cmake graphviz ninja-build python3-clang -y | |
| rustup default stable | |
| pip3 install ruff | |
| wget https://github.com/muttleyxd/clang-tools-static-binaries/releases/download/master-796e77c/clang-format-20_linux-amd64 | |
| echo "bbb30a777d075dfbe91aa146a1ea1fa0c1d4745efa9c5490ebf9f5a7a7dec679c22f1c6015d5c85cb5b5b22964d86ae65002f1d4145bfdd7f27022d981b58979 clang-format-20_linux-amd64" | sha512sum -c | |
| mv clang-format-20_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 | |
| wget --quiet -O doxygen.tar.gz https://www.doxygen.nl/files/doxygen-1.16.1.linux.bin.tar.gz | |
| tar xf doxygen.tar.gz | |
| mv doxygen-1.16.1/bin/doxygen ~/.local/bin | |
| - 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: Check documentation style (Doxygen) | |
| run: | | |
| doxygen --version | |
| doxygen -q | |
| if [ -s docs/warn.log ]; then | |
| echo "--------------------------------------------------" | |
| echo "Doxygen warnings:" | |
| cat docs/warn.log | |
| exit 1 | |
| fi | |
| - 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: Check Python code style (ruff format) | |
| run: | | |
| ruff --version | |
| ruff format | |
| - name: Check Python code style (ruff check) | |
| run: | | |
| ruff --version | |
| ruff check | |
| - 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.py | |
| - 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 commands & settings export | |
| run: | | |
| echo "<!DOCTYPE html><html><head><title></title></head><body>" > settingscommands.html | |
| scripts/export_settings_commands_table.py >> settingscommands.html | |
| echo "</body></html>" >> settingscommands.html | |
| tidy -errors --drop-empty-elements false settingscommands.html | |
| - 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 -DCLIENT=OFF -DDOWNLOAD_GTEST=OFF .. | |
| cmake --build . --config Release --target dilate | |
| - name: Check dilated images | |
| run: scripts/check_dilate.py release data | |
| - name: Build twmap tool | |
| run: | | |
| cargo install twmap-tools --git https://gitlab.com/Patiga/twmap.git/ --rev 1f192def57429a1f64ddb3ac8580744476cfdf1c --locked | |
| - 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 |