static_checks.yml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. name: 📊 Static Checks
  2. on: [push, pull_request]
  3. concurrency:
  4. group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-static
  5. cancel-in-progress: true
  6. jobs:
  7. static-checks:
  8. name: Static Checks (clang-format, black format, file format, documentation checks)
  9. runs-on: ubuntu-20.04
  10. steps:
  11. - name: Checkout
  12. uses: actions/checkout@v3
  13. # Azure repositories are not reliable, we need to prevent Azure giving us packages.
  14. - name: Make apt sources.list use the default Ubuntu repositories
  15. run: |
  16. sudo rm -f /etc/apt/sources.list.d/*
  17. sudo cp -f misc/ci/sources.list /etc/apt/sources.list
  18. wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
  19. sudo apt-add-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-13 main"
  20. sudo apt-get update
  21. - name: Install dependencies
  22. run: |
  23. sudo apt-get install -qq dos2unix recode clang-format-13 libxml2-utils
  24. sudo update-alternatives --remove-all clang-format
  25. sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-13 100
  26. sudo pip3 install black==22.3.0 pygments
  27. - name: File formatting checks (file_format.sh)
  28. run: |
  29. bash ./misc/scripts/file_format.sh
  30. - name: Python style checks via black (black_format.sh)
  31. run: |
  32. bash ./misc/scripts/black_format.sh
  33. - name: JavaScript style and documentation checks via ESLint and JSDoc
  34. run: |
  35. cd platform/javascript
  36. npm ci
  37. npm run lint
  38. npm run docs -- -d dry-run
  39. - name: Class reference schema checks
  40. run: |
  41. xmllint --noout --schema doc/class.xsd doc/classes/*.xml modules/*/doc_classes/*.xml
  42. - name: Documentation checks
  43. run: |
  44. doc/tools/make_rst.py --dry-run doc/classes modules
  45. - name: Style checks via clang-format (clang_format.sh)
  46. run: |
  47. bash ./misc/scripts/clang_format.sh