Update Documents #4
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: CI | |
| on: | |
| push: | |
| branches: [master, main, develop] | |
| pull_request: | |
| branches: [master, main] | |
| jobs: | |
| # ── Lint ────────────────────────────────────────────────────────────────── | |
| lint: | |
| name: Lint (pylint) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install pylint | |
| # Install package without GPIO deps — we are on x86 | |
| pip install -e . --no-deps | |
| - name: Run pylint | |
| run: | | |
| pylint RpiMotorLib/ \ | |
| --rcfile=.pylintrc \ | |
| --fail-under=8.0 | |
| # ── Tests ───────────────────────────────────────────────────────────────── | |
| test: | |
| name: Test (Python ${{ matrix.python-version }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.9", "3.10", "3.11", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install package and test deps | |
| run: | | |
| python -m pip install --upgrade pip | |
| # Install package without GPIO deps — tests mock all hardware | |
| pip install -e . --no-deps | |
| # Install test tools separately | |
| pip install pytest pytest-cov | |
| - name: Run tests with coverage | |
| run: | | |
| pytest tests/ --cov=RpiMotorLib --cov-report=term-missing | |
| - name: Upload coverage (Python 3.11 only) | |
| if: matrix.python-version == '3.11' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-report | |
| path: .coverage | |