ci.yml 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. name: ci
  2. on:
  3. push:
  4. branches: [main]
  5. pull_request:
  6. jobs:
  7. build:
  8. runs-on: ubuntu-latest
  9. strategy:
  10. matrix:
  11. python-version: ["3.9", "3.10", "3.11"]
  12. steps:
  13. - uses: actions/checkout@v3
  14. - name: Set up Python ${{ matrix.python-version }}
  15. uses: actions/setup-python@v4
  16. with:
  17. python-version: ${{ matrix.python-version }}
  18. - name: Install poetry
  19. uses: snok/install-poetry@v1
  20. with:
  21. version: 1.4.2
  22. virtualenvs-create: true
  23. virtualenvs-in-project: true
  24. - name: Load cached venv
  25. id: cached-poetry-dependencies
  26. uses: actions/cache@v2
  27. with:
  28. path: .venv
  29. key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
  30. - name: Install dependencies
  31. run: poetry install --all-extras
  32. if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
  33. - name: Lint with ruff
  34. run: make lint
  35. - name: Run tests and generate coverage report
  36. run: make coverage
  37. - name: Upload coverage reports to Codecov
  38. uses: codecov/codecov-action@v3
  39. with:
  40. file: coverage.xml
  41. env:
  42. CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}