fix: formatting #12
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 | |
| - develop | |
| pull_request: | |
| branches: | |
| - main | |
| - develop | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| cache: "pip" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| pip install -r requirements_test.txt | |
| - name: Run Ruff linter | |
| run: ruff check . | |
| - name: Run Ruff formatter check | |
| run: ruff format --check . | |
| - name: Run mypy | |
| run: mypy custom_components/sinricpro | |
| test: | |
| name: Test (Python ${{ matrix.python-version }}, HA ${{ matrix.ha-version }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.12"] | |
| ha-version: ["latest"] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: "pip" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| pip install -r requirements_test.txt | |
| if [ "${{ matrix.ha-version }}" != "latest" ]; then | |
| pip install homeassistant==${{ matrix.ha-version }} | |
| else | |
| pip install homeassistant | |
| fi | |
| - name: Run tests | |
| run: pytest tests/ -v | |
| validate: | |
| name: Validate Integration | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: HACS Validation | |
| uses: hacs/action@main | |
| with: | |
| category: integration | |
| continue-on-error: true | |
| - name: Hassfest Validation | |
| uses: home-assistant/actions/hassfest@master | |
| build: | |
| name: Build Package | |
| runs-on: ubuntu-latest | |
| needs: [lint, test, validate] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Create zip archive | |
| run: | | |
| cd custom_components | |
| zip -r ../sinricpro.zip sinricpro/ | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: sinricpro | |
| path: sinricpro.zip | |
| retention-days: 7 |