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