lint.yml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. # Workflow that runs lint on the frontend and python code
  2. name: Lint
  3. # Only run one workflow of the same group at a time.
  4. # There can be at most one running and one pending job in a concurrency group at any time.
  5. concurrency:
  6. group: ${{ github.workflow }}-${{ github.ref }}
  7. cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
  8. on:
  9. push:
  10. branches:
  11. - main
  12. pull_request:
  13. jobs:
  14. # Run lint on the frontend code
  15. lint-frontend:
  16. name: Lint frontend
  17. runs-on: ubuntu-latest
  18. steps:
  19. - uses: actions/checkout@v4
  20. - name: Install Node.js 20
  21. uses: actions/setup-node@v4
  22. with:
  23. node-version: 20
  24. - name: Install dependencies
  25. run: |
  26. cd frontend
  27. npm install --frozen-lockfile
  28. - name: Lint
  29. run: |
  30. cd frontend
  31. npm run lint
  32. # Run lint on the python code
  33. lint-python:
  34. name: Lint python
  35. runs-on: ubuntu-latest
  36. steps:
  37. - uses: actions/checkout@v4
  38. with:
  39. fetch-depth: 0
  40. - name: Set up python
  41. uses: actions/setup-python@v5
  42. with:
  43. python-version: 3.11
  44. cache: 'pip'
  45. - name: Install pre-commit
  46. run: pip install pre-commit==3.7.0
  47. - name: Run pre-commit hooks
  48. run: pre-commit run --files opendevin/**/* agenthub/**/* evaluation/**/* tests/**/* --show-diff-on-failure --config ./dev_config/python/.pre-commit-config.yaml