lint.yml 1.4 KB

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