static_checks.yml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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-24.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 libxml2-utils 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-16 100
  22. sudo pip3 install black==24.10.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: JavaScript style and documentation checks via ESLint and JSDoc
  30. run: |
  31. cd platform/javascript
  32. npm ci
  33. npm run lint
  34. npm run docs -- -d dry-run
  35. - name: Class reference schema checks
  36. run: |
  37. xmllint --noout --schema doc/class.xsd doc/classes/*.xml modules/*/doc_classes/*.xml
  38. - name: Documentation checks
  39. run: |
  40. doc/tools/make_rst.py --dry-run doc/classes modules
  41. - name: Style checks via clang-format (clang_format.sh)
  42. run: |
  43. bash ./misc/scripts/clang_format.sh