64 lines
1.5 KiB
YAML
64 lines
1.5 KiB
YAML
name: Python Tests
|
|
|
|
on:
|
|
push:
|
|
branches: [ "main", "master" ]
|
|
paths:
|
|
- "**.py"
|
|
- "pyproject.toml"
|
|
- "requirements.txt"
|
|
- "tests/**"
|
|
- "templates/**"
|
|
- "static/**"
|
|
- ".github/workflows/python-tests.yml"
|
|
pull_request:
|
|
paths:
|
|
- "**.py"
|
|
- "pyproject.toml"
|
|
- "requirements.txt"
|
|
- "tests/**"
|
|
- "templates/**"
|
|
- "static/**"
|
|
- ".github/workflows/python-tests.yml"
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
tests:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
python-version: [ "3.11", "3.12", "3.13" ]
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
python -m pip install -r requirements.txt
|
|
python -m pip install coverage
|
|
|
|
- name: Syntax check
|
|
run: |
|
|
python -m compileall -q outlook_web web_outlook_app.py outlook_mail_reader.py start.py tests
|
|
|
|
- name: Run unit tests with coverage
|
|
run: |
|
|
coverage run -m unittest discover -s tests -v
|
|
coverage xml
|
|
coverage report
|
|
|
|
- name: Upload coverage artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: coverage-python-${{ matrix.python-version }}
|
|
path: coverage.xml
|
|
|