build.yml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. name: build
  2. on:
  3. push:
  4. branches: [ "main" ]
  5. pull_request:
  6. branches: [ "main" ]
  7. permissions:
  8. contents: read
  9. jobs:
  10. build:
  11. runs-on: ubuntu-latest
  12. strategy:
  13. matrix:
  14. python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
  15. steps:
  16. - uses: actions/checkout@v3
  17. - name: Set up Python ${{ matrix.python-version }}
  18. uses: actions/setup-python@v4
  19. with:
  20. python-version: ${{ matrix.python-version }}
  21. - name: cache poetry install
  22. uses: actions/cache@v2
  23. with:
  24. path: ~/.local
  25. key: python-${{ matrix.python-version }}-poetry-1.3.1
  26. - uses: snok/install-poetry@v1
  27. with:
  28. version: 1.3.1
  29. virtualenvs-create: true
  30. virtualenvs-in-project: true
  31. - name: cache deps
  32. id: cache-deps
  33. uses: actions/cache@v2
  34. with:
  35. path: .venv
  36. key: python-${{ matrix.python-version }}-pydeps-${{ hashFiles('**/poetry.lock') }}
  37. - run: poetry install --no-interaction --no-root
  38. if: steps.cache-deps.outputs.cache-hit != 'true'
  39. - run: poetry install --no-interaction
  40. - run: poetry run pytest tests --cov --no-cov-on-fail --cov-report=
  41. - run: poetry run pyright reflex tests
  42. - run: poetry run ruff check . --format github
  43. - run: find reflex tests -name "*.py" -not -path reflex/reflex.py | xargs poetry run darglint
  44. - run: poetry run black --check reflex tests
  45. - run: poetry run coverage html