|
1 | | -name: Tests |
| 1 | +name: Python Tests |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
5 | | - branches: [ main, develop ] |
| 5 | + branches: [ main ] |
6 | 6 | pull_request: |
7 | 7 | branches: [ main ] |
8 | 8 |
|
9 | 9 | jobs: |
10 | 10 | test: |
11 | 11 | runs-on: ubuntu-latest |
12 | | - |
13 | | - strategy: |
14 | | - matrix: |
15 | | - python-version: ["3.10", "3.11", "3.12"] |
16 | | - |
| 12 | + |
17 | 13 | steps: |
18 | 14 | - uses: actions/checkout@v4 |
19 | | - |
20 | | - - name: Set up Python ${{ matrix.python-version }} |
| 15 | + |
| 16 | + - name: Set up Python |
21 | 17 | uses: actions/setup-python@v5 |
22 | 18 | with: |
23 | | - python-version: ${{ matrix.python-version }} |
24 | | - |
25 | | - - name: Install Python dependencies |
26 | | - run: | |
27 | | - python -m pip install --upgrade pip |
28 | | - pip install -e ".[dev]" |
29 | | - |
30 | | - - name: Run tests |
| 19 | + python-version: '3.12' # Use a stable version for CI reliability |
| 20 | + |
| 21 | + - name: Install System Dependencies |
31 | 22 | run: | |
32 | | - pytest -v --cov=src/pipewire_controller --cov-report=xml --cov-report=term-missing |
33 | | - |
34 | | - - name: Upload coverage to Codecov |
35 | | - uses: codecov/codecov-action@v4 |
36 | | - with: |
37 | | - file: ./coverage.xml |
38 | | - flags: unittests |
39 | | - name: codecov-umbrella |
40 | | - fail_ci_if_error: false |
41 | | - |
42 | | - - name: Run linting |
| 23 | + sudo apt-get update |
| 24 | + # Install pipewire-bin to provide the pw-metadata and pw-dump binaries |
| 25 | + sudo apt-get install -y pipewire-bin |
| 26 | +
|
| 27 | + - name: Install Python Dependencies |
43 | 28 | run: | |
44 | | - ruff check src/ tests/ |
45 | | - |
46 | | - - name: Check formatting |
| 29 | + python -m pip install --upgrade pip |
| 30 | + pip install pytest pytest-mock |
| 31 | + pip install -e . |
| 32 | +
|
| 33 | + - name: Run Tests |
47 | 34 | run: | |
48 | | - black --check src/ tests/ |
| 35 | + # We no longer need xvfb-run because we refactored to engine-only testing! |
| 36 | + export PYTHONPATH=$PYTHONPATH:$(pwd)/src |
| 37 | + pytest tests/test_engine.py |
0 commit comments