Repository navigation
feat: expose Q7 robot position #3950
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: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| env: | |
| # Default Python version for tooling jobs (lint, build, test-release) | |
| DEFAULT_PYTHON_VERSION: "3.11" | |
| # Matrix Python version that collects branch coverage and uploads to Codecov | |
| COVERAGE_PYTHON_VERSION: "3.14" | |
| jobs: | |
| # Make sure commit messages follow the conventional commits convention: | |
| # https://www.conventionalcommits.org | |
| commitlint: | |
| name: Lint Commit Messages | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - uses: wagoid/commitlint-github-action@v6.2.1 | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ env.DEFAULT_PYTHON_VERSION }} | |
| - uses: pre-commit/action@v3.0.1 | |
| test: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # Keep COVERAGE_PYTHON_VERSION in sync with this matrix | |
| python-version: | |
| - "3.11" # Minimum supported Python version | |
| - "3.14" # Latest supported Python version (coverage) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| activate-environment: true | |
| enable-cache: true | |
| - name: Test with Pytest | |
| run: >- | |
| uv run pytest -n auto | |
| ${{ matrix.python-version == env.COVERAGE_PYTHON_VERSION && '--cov --cov-branch --cov-report=xml' || '' }} | |
| shell: bash | |
| - name: Upload results to Codecov | |
| if: matrix.python-version == env.COVERAGE_PYTHON_VERSION | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| slug: Python-roborock/python-roborock | |
| test-mqtt: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # Keep COVERAGE_PYTHON_VERSION in sync with this matrix | |
| python-version: | |
| - "3.11" # Minimum supported Python version | |
| - "3.14" # Latest supported Python version (coverage) | |
| runs-on: ubuntu-latest | |
| services: | |
| emqx: | |
| image: emqx/emqx:6.2.3 | |
| ports: | |
| - 1888:1883 | |
| options: >- | |
| --health-cmd "/opt/emqx/bin/emqx ctl status" | |
| --health-interval 1s | |
| --health-timeout 25s | |
| --health-retries 25 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| activate-environment: true | |
| enable-cache: true | |
| - name: Test MQTT with Pytest | |
| run: >- | |
| uv run pytest -m mqtt_broker | |
| ${{ matrix.python-version == env.COVERAGE_PYTHON_VERSION && '--cov --cov-branch --cov-report=xml' || '' }} | |
| - name: Upload results to Codecov | |
| if: matrix.python-version == env.COVERAGE_PYTHON_VERSION | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| slug: Python-roborock/python-roborock | |
| build: | |
| name: Build Package | |
| runs-on: ubuntu-latest | |
| if: github.ref != 'refs/heads/main' | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| python-version: ${{ env.DEFAULT_PYTHON_VERSION }} | |
| activate-environment: true | |
| enable-cache: true | |
| - name: Build package | |
| run: uv build | |
| # Test semantic-release configuration on PR branches | |
| test-release: | |
| name: Test Semantic Release | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'pull_request' | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| python-version: ${{ env.DEFAULT_PYTHON_VERSION }} | |
| enable-cache: true | |
| - name: Setup Git for Semantic Release Testing | |
| run: | | |
| # Setup a temp branch to test | |
| git checkout -B temp-main-branch | |
| git merge ${{ github.event.pull_request.head.sha }} --no-edit | |
| git config user.name "GitHub Actions" | |
| git config user.email "actions@github.com" | |
| - name: Test Semantic Release (Dry Run) | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # Keep version in sync with python-semantic-release action in the release job | |
| run: >- | |
| uv tool run --from python-semantic-release==10.5.3 | |
| semantic-release version --changelog --no-commit --no-tag --no-push --no-vcs-release | |
| release: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - test | |
| - test-mqtt | |
| concurrency: release | |
| if: github.ref == 'refs/heads/main' | |
| permissions: | |
| contents: write | |
| issues: write | |
| pull-requests: write | |
| id-token: write | |
| actions: write | |
| packages: write | |
| environment: | |
| name: release | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Create release GitHub App token | |
| id: release-token | |
| uses: actions/create-github-app-token@v3 | |
| with: | |
| client-id: ${{ vars.RELEASE_APP_CLIENT_ID }} | |
| private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }} | |
| permission-contents: write | |
| - name: Python Semantic Release | |
| id: release | |
| uses: python-semantic-release/python-semantic-release@v10.5.3 | |
| with: | |
| # The release App is allowed to bypass the pull-request requirement so | |
| # semantic-release can commit the version and changelog back to main. | |
| github_token: ${{ steps.release-token.outputs.token }} | |
| changelog: true | |
| - name: Publish package distributions to PyPI | |
| uses: pypa/gh-action-pypi-publish@v1.14.2 | |
| # NOTE: DO NOT wrap the conditional in ${{ }} as it will always evaluate to true. | |
| # See https://github.com/actions/runner/issues/1173 | |
| if: steps.release.outputs.released == 'true' | |
| with: | |
| packages-dir: dist | |
| print-hash: true | |
| verbose: true | |
| - name: Publish package distributions to GitHub Releases | |
| uses: python-semantic-release/publish-action@v10.5.3 | |
| if: steps.release.outputs.released == 'true' | |
| with: | |
| github_token: ${{ steps.release-token.outputs.token }} | |
| tag: ${{ steps.release.outputs.tag }} |