pytest.yaml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. name: Pytest
  2. env:
  3. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  4. on:
  5. push:
  6. branches:
  7. - main
  8. paths-ignore:
  9. - 'docs/**'
  10. - 'README.md'
  11. - 'mkdocs.yml'
  12. pull_request:
  13. branches:
  14. - main
  15. paths-ignore:
  16. - 'docs/**'
  17. - 'README.md'
  18. - 'mkdocs.yml'
  19. # Not possible to test windows capability:
  20. # https://github.com/orgs/community/discussions/25491
  21. jobs:
  22. test:
  23. runs-on: ubuntu-latest
  24. defaults:
  25. run:
  26. shell: bash -l {0}
  27. steps:
  28. - name: Checkout code
  29. uses: actions/checkout@v2
  30. - uses: actions/setup-python@v5
  31. with:
  32. python-version: '3.9'
  33. - name: Pull swe-agent docker container
  34. run: |
  35. docker pull sweagent/swe-agent:latest
  36. - name: Create keys.cfg
  37. run: |
  38. touch keys.cfg
  39. - name: Install uv
  40. run: |
  41. curl -LsSf https://astral.sh/uv/install.sh | sh
  42. - name: Install dependencies
  43. run: |
  44. uv pip install --python ${Python_ROOT_DIR} '.[dev]'
  45. - name: Run pytest
  46. uses: sjvrijn/pytest-last-failed@v2
  47. with:
  48. pytest-args: '--exitfirst --cov'
  49. - name: Explicitly convert coverage to xml
  50. run: coverage xml
  51. - name: Upload coverage reports to Codecov
  52. uses: codecov/codecov-action@v4.0.1
  53. with:
  54. token: ${{ secrets.CODECOV_TOKEN }}
  55. slug: princeton-nlp/SWE-agent