on_pull_request.yaml 950 B

12345678910111213141516171819202122232425262728293031323334
  1. name: Run Linting/Formatting on Pull Requests
  2. on:
  3. - push
  4. - pull_request
  5. jobs:
  6. lint-python:
  7. runs-on: ubuntu-latest
  8. steps:
  9. - name: Checkout Code
  10. uses: actions/checkout@v3
  11. - uses: actions/setup-python@v4
  12. with:
  13. python-version: 3.11
  14. # NB: there's no cache: pip here since we're not installing anything
  15. # from the requirements.txt file(s) in the repository; it's faster
  16. # not to have GHA download an (at the time of writing) 4 GB cache
  17. # of PyTorch and other dependencies.
  18. - name: Install Ruff
  19. run: pip install ruff==0.0.265
  20. - name: Run Ruff
  21. run: ruff .
  22. lint-js:
  23. runs-on: ubuntu-latest
  24. steps:
  25. - name: Checkout Code
  26. uses: actions/checkout@v3
  27. - name: Install Node.js
  28. uses: actions/setup-node@v3
  29. with:
  30. node-version: 18
  31. - run: npm i --ci
  32. - run: npm run lint