lint.yml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. # Workflow that runs lint on the frontend and python code
  2. name: Lint
  3. # The jobs in this workflow are required, so they must run at all times
  4. # Always run on "main"
  5. # Always run on PRs
  6. on:
  7. push:
  8. branches:
  9. - main
  10. pull_request:
  11. jobs:
  12. # Run lint on the frontend code
  13. lint-frontend:
  14. name: Lint frontend
  15. runs-on: ubuntu-latest
  16. steps:
  17. - uses: actions/checkout@v4
  18. - name: Install Node.js 20
  19. uses: actions/setup-node@v4
  20. with:
  21. node-version: 20
  22. - name: Install dependencies
  23. run: |
  24. cd frontend
  25. npm install --frozen-lockfile
  26. - name: Lint
  27. run: |
  28. cd frontend
  29. npm run lint
  30. # Run lint on the python code
  31. lint-python:
  32. name: Lint python
  33. runs-on: ubuntu-latest
  34. steps:
  35. - uses: actions/checkout@v4
  36. with:
  37. fetch-depth: 0
  38. - name: Set up python
  39. uses: actions/setup-python@v5
  40. with:
  41. python-version: 3.12
  42. cache: 'pip'
  43. - name: Install pre-commit
  44. run: pip install pre-commit==3.7.0
  45. - name: Run pre-commit hooks
  46. run: pre-commit run --files openhands/**/* evaluation/**/* tests/**/* --show-diff-on-failure --config ./dev_config/python/.pre-commit-config.yaml