ci: Add comprehensive automated testing workflows and documentation
This commit is contained in:
53
.github/workflows/ci.yml
vendored
53
.github/workflows/ci.yml
vendored
@@ -58,8 +58,42 @@ jobs:
|
||||
run: uv run bandit -c pyproject.toml -r scripts/ --exclude scripts/tests/
|
||||
|
||||
test:
|
||||
name: Tests
|
||||
name: Unit Tests (Python ${{ matrix.python-version }})
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
python-version: ['3.10', '3.11', '3.12']
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v4
|
||||
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
run: uv python install ${{ matrix.python-version }}
|
||||
|
||||
- name: Create venv and install dependencies
|
||||
run: |
|
||||
uv venv
|
||||
uv pip install -r requirements-dev.txt
|
||||
|
||||
- name: Run pytest with coverage
|
||||
run: uv run pytest scripts/tests/ -v --tb=short --cov=scripts --cov-report=xml --cov-report=term-missing
|
||||
|
||||
- name: Upload coverage to Codecov
|
||||
uses: codecov/codecov-action@v3
|
||||
with:
|
||||
files: ./coverage.xml
|
||||
flags: unittests
|
||||
name: codecov-python-${{ matrix.python-version }}
|
||||
fail_ci_if_error: false
|
||||
|
||||
build:
|
||||
name: Build EPUB
|
||||
runs-on: ubuntu-latest
|
||||
needs: [lint, security, test]
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
@@ -73,22 +107,7 @@ jobs:
|
||||
- name: Create venv and install dependencies
|
||||
run: |
|
||||
uv venv
|
||||
uv pip install -r requirements.txt
|
||||
uv pip install pytest pytest-asyncio
|
||||
|
||||
- name: Run Tests
|
||||
run: uv run pytest scripts/tests/ -v --tb=short
|
||||
|
||||
build:
|
||||
name: Build EPUB
|
||||
runs-on: ubuntu-latest
|
||||
needs: [lint, security, test]
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v4
|
||||
uv pip install -r requirements-dev.txt
|
||||
|
||||
- name: Build EPUB
|
||||
run: uv run scripts/build_epub.py
|
||||
|
||||
Reference in New Issue
Block a user