lint.yml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. name: Lint
  2. on:
  3. push:
  4. branches:
  5. - main
  6. pull_request:
  7. jobs:
  8. lint-frontend:
  9. name: Lint frontend
  10. runs-on: ubuntu-latest
  11. steps:
  12. - uses: actions/checkout@v4
  13. - name: Install Node.js 20
  14. uses: actions/setup-node@v4
  15. with:
  16. node-version: 20
  17. - name: Install dependencies
  18. run: |
  19. cd frontend
  20. npm install --frozen-lockfile
  21. - name: Lint
  22. run: |
  23. cd frontend
  24. npm run lint
  25. lint-python:
  26. name: Lint python
  27. runs-on: ubuntu-latest
  28. steps:
  29. - uses: actions/checkout@v4
  30. with:
  31. fetch-depth: 0
  32. - name: Set up python
  33. uses: actions/setup-python@v5
  34. with:
  35. python-version: 3.11
  36. cache: 'pip'
  37. - name: Install pre-commit
  38. run: pip install pre-commit==3.7.0
  39. - name: Run pre-commit hooks
  40. run: |
  41. git fetch https://github.com/OpenDevin/OpenDevin.git main:main && \
  42. pre-commit run \
  43. --files \
  44. $(git diff --name-only $(git merge-base main $(git branch --show-current)) $(git branch --show-current) | tr '\n' ' ') \
  45. --show-diff-on-failure \
  46. --config ./dev_config/python/.pre-commit-config.yaml