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

41 lines
1 KiB
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.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
pip install pytest torch==2.2.2+cpu -f https://download.pytorch.org/whl/torch_stable.html
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Run tests with pytest
run: |
pytest --maxfail=5 --disable-warnings --tb=short