Video qt #355
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test suite | |
| on: | |
| push: | |
| branches: ["master"] | |
| pull_request: | |
| branches: ["master"] | |
| jobs: | |
| tests: | |
| name: "Python ${{ matrix.python-version }}" | |
| runs-on: "ubuntu-latest" | |
| permissions: write-all | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12", "3.13"] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install necessary packages | |
| run: | | |
| sudo apt-get install -y linux-image-$(uname -r) linux-modules-extra-$(uname -r) | |
| - name: Setup user groups | |
| run: | | |
| sudo python scripts/test_setup.py | |
| ls -lsa /dev/video* /dev/uinput /dev/gpio* /dev/inp* | |
| - name: Set up Python ${{ matrix.python-version }} | |
| id: setuppy | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| # Issue ref: https://github.com/actions/setup-python/issues/436 | |
| # cache: 'pip' | |
| # cache-dependency-path: pyproject.toml | |
| - uses: actions/cache@v4 | |
| id: cache | |
| with: | |
| path: ${{ env.pythonLocation }} | |
| key: python-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }} | |
| - name: Install dependencies | |
| if: steps.cache.outputs.cache-hit != 'true' | |
| run: | | |
| pip install --disable-pip-version-check -e . --group=dev | |
| - name: Linting | |
| run: | | |
| ruff check --diff --output-format=github linuxpy tests examples | |
| ruff format linuxpy tests examples --check | |
| - name: Build package | |
| run: | | |
| python -m build | |
| twine check dist/* | |
| - name: Tests | |
| id: tests | |
| run: | | |
| pytest | |
| - name: Upload coverage data | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: html_report-${{ matrix.python-version }} | |
| path: ./htmlcov/ | |
| - name: Code Coverage Summary Report | |
| uses: irongut/CodeCoverageSummary@v1.3.0 | |
| with: | |
| filename: coverage.xml | |
| badge: true | |
| format: 'markdown' | |
| output: 'both' | |
| - name: Add Coverage PR Comment | |
| uses: marocchino/sticky-pull-request-comment@v2 | |
| if: github.event_name == 'pull_request' | |
| with: | |
| path: code-coverage-results.md | |
| recreate: true | |
| - name: Write to Job Summary | |
| run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY |