ci.yml 1.4 KB

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