static_checks.yml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. name: 📊 Static Checks
  2. on:
  3. workflow_call:
  4. concurrency:
  5. group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-static
  6. cancel-in-progress: true
  7. jobs:
  8. static-checks:
  9. name: Static Checks (clang-format, black format, file format, documentation checks)
  10. runs-on: "ubuntu-20.04"
  11. steps:
  12. - name: Checkout
  13. uses: actions/checkout@v4
  14. - name: Install dependencies
  15. run: |
  16. # Azure repositories are flaky, remove them.
  17. sudo rm -f /etc/apt/sources.list.d/{azure,microsoft}*
  18. sudo apt-get update
  19. sudo apt-get install -qq dos2unix python3-pip moreutils
  20. sudo update-alternatives --remove-all clang-format || true
  21. sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-10 100
  22. sudo pip3 install black==24.8.0 pygments
  23. - name: File formatting checks (file_format.sh)
  24. run: |
  25. bash ./misc/scripts/file_format.sh
  26. - name: Python style checks via black (black_format.sh)
  27. run: |
  28. bash ./misc/scripts/black_format.sh
  29. - name: Documentation checks
  30. run: |
  31. doc/tools/makerst.py --dry-run doc/classes modules
  32. - name: Style checks via clang-format (clang_format.sh)
  33. run: |
  34. bash ./misc/scripts/clang_format.sh