This repository was archived by the owner on Sep 26, 2025. It is now read-only.
[pre-commit.ci] pre-commit autoupdate #922
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" | |
| on: | |
| push: | |
| branches: | |
| - "main" | |
| - "feature/*" | |
| pull_request: | |
| branches: | |
| - "main" | |
| jobs: | |
| test: | |
| name: "Test" | |
| runs-on: "ubuntu-latest" | |
| steps: | |
| - name: "Checkout the repository" | |
| uses: "actions/[email protected]" | |
| - name: "Set up Python" | |
| uses: actions/[email protected] | |
| with: | |
| python-version: "3.13" | |
| cache: "pip" | |
| - name: "Install requirements" | |
| run: pip install -r requirements-dev.txt | |
| - name: "Test" | |
| run: pytest tests --doctest-modules --junitxml=pytest.xml --cov --cov=custom_components/ --cov-report=term-missing | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: .coverage | |
| path: .coverage | |
| retention-days: 1 | |
| include-hidden-files: true | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: pytest.xml | |
| path: pytest.xml | |
| retention-days: 1 | |
| coverage-upload: | |
| name: "Coverage Upload" | |
| runs-on: "ubuntu-latest" | |
| needs: test | |
| if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main'}} | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: "Checkout the repository" | |
| uses: "actions/[email protected]" | |
| - name: "Set up Python" | |
| uses: actions/[email protected] | |
| with: | |
| python-version: "3.13" | |
| - name: Install coverage.py | |
| run: pip install coverage | |
| - uses: actions/download-artifact@v5 | |
| with: | |
| name: .coverage | |
| - run: coverage json | |
| - run: mkdir -p ./gh-pages-coverage | |
| - run: mv coverage.json ./gh-pages-coverage | |
| - name: Store coverage report in gh-pages | |
| uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| folder: gh-pages-coverage # The folder the action should dep | |
| target-folder: coverage | |
| commit-message: Upload latest coverage report | |
| coverage-comment: | |
| name: "Coverage Comment" | |
| runs-on: "ubuntu-latest" | |
| needs: test | |
| if: ${{ github.event_name == 'pull_request' }} | |
| permissions: | |
| issues: write | |
| pull-requests: write | |
| contents: write | |
| steps: | |
| - name: "Checkout the repository" | |
| uses: "actions/[email protected]" | |
| - name: "Set up Python" | |
| uses: actions/[email protected] | |
| with: | |
| python-version: "3.13" | |
| - name: Install coverage.py | |
| run: pip install coverage | |
| - uses: actions/download-artifact@v5 | |
| with: | |
| name: .coverage | |
| - uses: actions/download-artifact@v5 | |
| with: | |
| name: pytest.xml | |
| - run: coverage xml | |
| - name: Pytest coverage comment | |
| uses: MishaKav/[email protected] | |
| with: | |
| pytest-xml-coverage-path: ./coverage.xml | |
| junitxml-path: ./pytest.xml |