Adapt conftest #3921
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
| # This workflow will install Python dependencies, run tests and lint with a variety of Python versions | |
| # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
| name: Test against HA-core (master/released) | |
| env: | |
| CACHE_VERSION: 29 | |
| DEFAULT_PYTHON: "3.13" | |
| on: | |
| workflow_dispatch: | |
| push: | |
| # pull_request: | |
| jobs: | |
| # Run pre-commit | |
| pre-commit: | |
| name: Validate pre-commit requirements | |
| runs-on: ubuntu-latest | |
| if: github.ref != 'refs/heads/main' | |
| steps: | |
| - name: Check out committed code | |
| uses: actions/[email protected] | |
| - name: Set up Python ${{ env.DEFAULT_PYTHON }} | |
| id: python | |
| uses: actions/[email protected] | |
| with: | |
| python-version: ${{ env.DEFAULT_PYTHON }} | |
| - name: Restore base HA-core Python ${{ env.DEFAULT_PYTHON }} environment | |
| id: cache-hacore | |
| uses: actions/[email protected] | |
| env: | |
| cache-name: cache-hacore | |
| with: | |
| path: ./ | |
| key: >- | |
| ${{ env.CACHE_VERSION}}-${{ runner.os }}-base-hacore-${{ | |
| steps.python.outputs.python-version }}-${{ | |
| hashFiles('./custom_components/plugwise/manifest.json') }}-${{ | |
| hashFiles('./ha-core/.git/plugwise-tracking') }} | |
| restore-keys: | | |
| ${{ env.CACHE_VERSION}}-${{ runner.os }}-base-hacore-${{ steps.python.outputs.python-version }}- | |
| ${{ env.CACHE_VERSION}}-${{ runner.os }}-base-hacore | |
| ${{ env.CACHE_VERSION}}-${{ runner.os }} | |
| ${{ env.CACHE_VERSION}} | |
| - name: Set-up environment | |
| run: | | |
| scripts/setup.sh | |
| - name: Install pre-commit dependencies | |
| run: | | |
| . venv/bin/activate | |
| pre-commit install-hooks | |
| - name: Run full pre-commit | |
| run: | | |
| . venv/bin/activate | |
| pre-commit run --all-files --show-diff-on-failure | |
| env: # While not problematic, save time on performing the local hooks as they are run from the complete script in the next job | |
| SKIP: local-test-core-prep,local-test-pip-prep,local-testing,local-quality | |
| # Prepare default python version environment | |
| ha-core-prepare: | |
| runs-on: ubuntu-latest | |
| name: Setup for HA-core (release) | |
| needs: | |
| - pre-commit | |
| steps: | |
| - name: Check out committed code | |
| uses: actions/[email protected] | |
| - name: Set up Python ${{ env.DEFAULT_PYTHON }} | |
| id: python | |
| uses: actions/[email protected] | |
| with: | |
| python-version: ${{ env.DEFAULT_PYTHON }} | |
| - name: Restore base HA-core Python ${{ env.DEFAULT_PYTHON }} environment | |
| id: cache-hacore | |
| uses: actions/[email protected] | |
| env: | |
| cache-name: cache-hacore | |
| with: | |
| path: ./ | |
| key: >- | |
| ${{ env.CACHE_VERSION}}-${{ runner.os }}-base-hacore-${{ | |
| steps.python.outputs.python-version }}-${{ | |
| hashFiles('./custom_components/plugwise/manifest.json') }}-${{ | |
| hashFiles('./ha-core/.git/plugwise-tracking') }} | |
| restore-keys: | | |
| ${{ env.CACHE_VERSION}}-${{ runner.os }}-base-hacore-${{ steps.python.outputs.python-version }}- | |
| ${{ env.CACHE_VERSION}}-${{ runner.os }}-base-hacore | |
| ${{ env.CACHE_VERSION}}-${{ runner.os }} | |
| ${{ env.CACHE_VERSION}} | |
| - name: Test through HA-core (master/release) | |
| run: | | |
| GITHUB_ACTIONS="" BRANCH="master" scripts/core-testing.sh | |
| shellcheck: | |
| name: Shellcheck | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/[email protected] | |
| - name: Run ShellCheck | |
| uses: ludeeus/action-shellcheck@master |