| 1 | --- |
| 2 | name: Test |
| 3 | |
| 4 | on: |
| 5 | push: |
| 6 | branches: |
| 7 | - main |
| 8 | pull_request: |
| 9 | branches: |
| 10 | - main |
| 11 | |
| 12 | jobs: |
| 13 | build: |
| 14 | runs-on: ubuntu-latest |
| 15 | strategy: |
| 16 | fail-fast: false |
| 17 | matrix: |
| 18 | python-version: ["3.11", "3.12"] |
| 19 | |
| 20 | steps: |
| 21 | - uses: actions/checkout@v4 |
| 22 | - name: Set up Python ${{ matrix.python-version }} |
| 23 | uses: actions/setup-python@v5 |
| 24 | with: |
| 25 | python-version: ${{ matrix.python-version }} |
| 26 | - name: Install dependencies |
| 27 | run: | |
| 28 | python -m pip install --upgrade pip |
| 29 | if [ -f requirements_dev.txt ]; then pip install -r requirements_dev.txt; fi |
| 30 | |
| 31 | - name: Test with pytest |
| 32 | run: | |
| 33 | pytest --cov=rtsp_to_webrtc --cov-report=term-missing |
| 34 | |
| 35 | - uses: codecov/codecov-action@v4 |
| 36 | with: |
| 37 | token: ${{ secrets.CODECOV_TOKEN }} |
| 38 | env_vars: OS,PYTHON |
| 39 | fail_ci_if_error: true |
| 40 | verbose: true |