xiaozhi-esp32-server/.github/workflows/unit_test.yml
2025-03-02 15:15:17 +09:00

41 lines
977 B
YAML

name: Run Tests
on:
pull_request:
branches:
- "*"
types:
- opened
- reopened
- synchronize
push:
branches:
- main
jobs:
test:
name: Run Pytest on Ubuntu and macOS
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install pytest
- name: Run tests with pytest
run: |
pytest --maxfail=5 --disable-warnings --tb=short