
* remove deprecated features and support for py3.9 * remove other deprecated stuff * update lock file * fix units tests * relock poetry * fix _replace for computed_var * fix some merge typo * fix typing of deploy args * fix benchmarks.yml versions * console.error instead of raising Exception * fix tests * ignore lambdas when resolving annotations * simplify redirect logic in event.py * more fixes * fix unit tests again * give back default annotations for lambdas * fix signature check for on_submit * remove useless stuff * update pyi * readd the getattr * raise if log_level is wrong type * silly goose, loglevel is a subclass of str * i don't believe this code * add guard --------- Co-authored-by: Khaleel Al-Adhami <khaleel.aladhami@gmail.com>
110 lines
3.4 KiB
YAML
110 lines
3.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]
|
|
python-version: ["3.10.16", "3.11.11", "3.12.8", "3.13.1"]
|
|
# Windows is a bit behind on Python version availability in Github
|
|
exclude:
|
|
- os: windows-latest
|
|
python-version: "3.11.11"
|
|
- os: windows-latest
|
|
python-version: "3.10.16"
|
|
include:
|
|
- os: windows-latest
|
|
python-version: "3.11.9"
|
|
- os: windows-latest
|
|
python-version: "3.10.11"
|
|
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/units --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/units --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/units --cov --no-cov-on-fail --cov-report=
|
|
- name: Generate coverage report
|
|
run: poetry run coverage html
|
|
|
|
unit-tests-macos:
|
|
timeout-minutes: 30
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
# Note: py310, py311 versions chosen due to available arm64 darwin builds.
|
|
python-version: ["3.10.11", "3.11.9", "3.12.8", "3.13.1"]
|
|
runs-on: macos-latest
|
|
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/units --cov --no-cov-on-fail --cov-report=
|
|
- name: Run unit tests w/ pydantic v1
|
|
run: |
|
|
export PYTHONUNBUFFERED=1
|
|
poetry run uv pip install "pydantic~=1.10"
|
|
poetry run pytest tests/units --cov --no-cov-on-fail --cov-report=
|