on_pull_request.yaml 1.2 KB

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