reflex/.github/workflows/unit_tests.yml
Masen Furer 2883e541a9
Bring back py3.9 support with a deprecation warning. (#3976)
* Revert "ruff formatting to unbreak `main` CI (#3964)"

This reverts commit f9be184b86.

* Revert "bump python>=3.10 for 0.6.0 (#3956)"

This reverts commit fe1833c5e1.

* drop python3.8 support

* relock dependencies

* Raise warning when < py310 is used

* Move python version check to reflex version check function

Avoid spammy deprecation warnings by only emitting warning once per project,
per reflex version, per reinit.

* Remove other references to python3.8
2024-09-23 18:15:16 -07:00

82 lines
2.4 KiB
YAML

name: unit-tests
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.id }}
cancel-in-progress: true
on:
push:
branches: ['main']
paths-ignore:
- '**/*.md'
pull_request:
branches: ['main']
paths-ignore:
- '**/*.md'
permissions:
contents: read
defaults:
run:
shell: bash
jobs:
unit-tests:
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-12]
python-version: ['3.9.18', '3.10.13', '3.11.5', '3.12.0']
# Windows is a bit behind on Python version availability in Github
exclude:
- os: windows-latest
python-version: '3.10.13'
- os: windows-latest
python-version: '3.9.18'
include:
- os: windows-latest
python-version: '3.10.11'
- os: windows-latest
python-version: '3.9.13'
runs-on: ${{ matrix.os }}
# Service containers to run with `runner-job`
services:
# Label used to access the service container
redis:
image: ${{ matrix.os == 'ubuntu-latest' && 'redis' || '' }}
# Set health checks to wait until redis has started
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps port 6379 on service container to the host
- 6379:6379
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup_build_env
with:
python-version: ${{ matrix.python-version }}
run-poetry-install: true
create-venv-at-path: .venv
- name: Run unit tests
run: |
export PYTHONUNBUFFERED=1
poetry run pytest tests --cov --no-cov-on-fail --cov-report=
- name: Run unit tests w/ redis
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
export PYTHONUNBUFFERED=1
export REDIS_URL=redis://localhost:6379
poetry run pytest tests --cov --no-cov-on-fail --cov-report=
# Change to explicitly install v1 when reflex-hosting-cli is compatible with v2
- name: Run unit tests w/ pydantic v1
run: |
export PYTHONUNBUFFERED=1
poetry run uv pip install "pydantic~=1.10"
poetry run pytest tests --cov --no-cov-on-fail --cov-report=
- run: poetry run coverage html