diff options
author | Aaron Franke <arnfranke@yahoo.com> | 2022-10-09 01:25:44 -0500 |
---|---|---|
committer | Aaron Franke <arnfranke@yahoo.com> | 2022-10-09 01:46:28 -0500 |
commit | bcfa3bf32065af70fc637d74d4fc438b36add7d6 (patch) | |
tree | 9702c72bf116993e3c48a17bf000b0dd75ff3e2a /.github/workflows | |
parent | f69f1bb58f84f3ee63b867a039da2bf475750489 (diff) | |
download | redot-cpp-bcfa3bf32065af70fc637d74d4fc438b36add7d6.tar.gz |
Add more static checks and move to separate file to match main repo
Diffstat (limited to '.github/workflows')
-rw-r--r-- | .github/workflows/ci.yml | 32 | ||||
-rw-r--r-- | .github/workflows/static_checks.yml | 54 |
2 files changed, 54 insertions, 32 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8db90cd..4665ed9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -192,35 +192,3 @@ jobs: run: | cd test && cmake -DCMAKE_BUILD_TYPE=Release -DGODOT_HEADERS_PATH="../godot-headers" -DCPP_BINDINGS_PATH=".." -G"Visual Studio 16 2019" . cmake --build . --verbose - - static-checks: - name: 📊 Static Checks (clang-format) - runs-on: ubuntu-20.04 - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Make apt sources.list use the default Ubuntu repositories - run: | - sudo rm -f /etc/apt/sources.list.d/* - sudo cp -f misc/ci/sources.list /etc/apt/sources.list - sudo apt-get update - - - name: Install dependencies - run: | - sudo apt-get install -qq dos2unix recode clang-format-11 - sudo update-alternatives --remove-all clang-format - sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-11 100 - python -m pip install black==22.3.0 - - - name: Style checks via clang-format - run: | - bash ./misc/scripts/clang_format.sh - - - name: Python style checks via black (black_format.sh) - run: | - bash ./misc/scripts/black_format.sh - - - name: Bindings generation checks (ensures get_file_list returns all generated files) - run: | - python ./misc/scripts/check_get_file_list.py diff --git a/.github/workflows/static_checks.yml b/.github/workflows/static_checks.yml new file mode 100644 index 0000000..5960288 --- /dev/null +++ b/.github/workflows/static_checks.yml @@ -0,0 +1,54 @@ +name: 📊 Static Checks +on: [push, pull_request] + +concurrency: + group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-static + cancel-in-progress: true + +jobs: + static-checks: + name: Format (clang-format, black format, file format) + runs-on: ubuntu-20.04 + steps: + - name: Checkout + uses: actions/checkout@v3 + + # Azure repositories are not reliable, we need to prevent Azure giving us packages. + - name: Make apt sources.list use the default Ubuntu repositories + run: | + sudo rm -f /etc/apt/sources.list.d/* + sudo cp -f misc/ci/sources.list /etc/apt/sources.list + wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - + sudo apt-add-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-13 main" + sudo apt-get update + + - name: Install dependencies + run: | + sudo apt-get install -qq dos2unix recode clang-format-13 libxml2-utils python3-pip moreutils + sudo update-alternatives --remove-all clang-format || true + sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-13 100 + sudo pip3 install black==22.3.0 pygments pytest==7.1.2 mypy==0.971 + + - name: File formatting checks (file_format.sh) + run: | + bash ./misc/scripts/file_format.sh + + - name: Header guards formatting checks (header_guards.sh) + run: | + bash ./misc/scripts/header_guards.sh + + - name: Python style checks via black (black_format.sh) + run: | + bash ./misc/scripts/black_format.sh + + - name: Python scripts static analysis (mypy_check.sh) + run: | + bash ./misc/scripts/mypy_check.sh + + - name: Bindings generation checks (ensures get_file_list returns all generated files) + run: | + python ./misc/scripts/check_get_file_list.py + + - name: Style checks via clang-format (clang_format.sh) + run: | + bash ./misc/scripts/clang_format.sh |