Илья Глазунов eeeccd57da
Some checks failed
Lint Code / lint (push) Failing after 44s
CI/CD Pipeline / lint (push) Successful in 0s
Run Tests / test (3.12) (push) Successful in 3m48s
Run Tests / test (3.13) (push) Successful in 3m7s
CI/CD Pipeline / test (push) Successful in 1s
CI/CD Pipeline / build-and-release (push) Has been skipped
CI/CD Pipeline / notify (push) Successful in 1s
Cython routing added
2026-01-31 02:44:50 +03:00

65 lines
1.8 KiB
YAML

name: Run Tests
run-name: ${{ gitea.actor }} started tests
on:
push:
branches: ["dev", "master", "main"]
pull_request:
branches: ["dev", "master", "main"]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.12', '3.13']
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libpcre2-dev
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: latest
virtualenvs-create: true
virtualenvs-in-project: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --with dev
- name: Build Cython extensions
run: poetry run python scripts/build_cython.py build_ext --inplace
- name: Run tests
run: poetry run pytest tests/ -v
- name: Run tests with coverage
run: poetry run pytest tests/ -v --cov=pyserve --cov-report=xml --cov-report=term
- name: Upload coverage to artifacts
uses: actions/upload-artifact@v3
with:
name: coverage-report-${{ matrix.python-version }}
path: coverage.xml
- name: Tests completed
run: echo "All tests passed successfully on Python ${{ matrix.python-version }}!"