56 lines
1.4 KiB
YAML
56 lines
1.4 KiB
YAML
name: build
|
|
|
|
on:
|
|
push:
|
|
branches: [ "main" ]
|
|
pull_request:
|
|
branches: [ "main" ]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: cache poetry install
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ~/.local
|
|
key: python-${{ matrix.python-version }}-poetry-1.3.1
|
|
|
|
- uses: snok/install-poetry@v1
|
|
with:
|
|
version: 1.3.1
|
|
virtualenvs-create: true
|
|
virtualenvs-in-project: true
|
|
|
|
- name: cache deps
|
|
id: cache-deps
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: .venv
|
|
key: python-${{ matrix.python-version }}-pydeps-${{ hashFiles('**/poetry.lock') }}
|
|
|
|
- run: poetry install --no-interaction --no-root
|
|
if: steps.cache-deps.outputs.cache-hit != 'true'
|
|
- run: poetry install --no-interaction
|
|
- run: poetry run pytest tests --cov --no-cov-on-fail --cov-report=
|
|
- run: poetry run pyright reflex tests
|
|
- run: poetry run ruff check . --format github
|
|
- run: find reflex tests -name "*.py" -not -path reflex/reflex.py | xargs poetry run darglint
|
|
- run: poetry run black --check reflex tests
|
|
- run: poetry run coverage html
|