Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 0 additions & 60 deletions .github/actions/restore-venv/action.yml

This file was deleted.

98 changes: 29 additions & 69 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Fetch HA pyproject
id: core-version
run: wget -O ha_pyproject.toml "https://raw.githubusercontent.com/home-assistant/core/refs/heads/dev/pyproject.toml"
- name: Compute cache key
id: set-key
run: echo "cache-key=${{ runner.os }}-venv-cache-${{ env.CACHE_VERSION }}-${{ steps.python.outputs.python-version }}-${{ hashFiles('pyproject.toml', 'requirements_test.txt', '.pre-commit-config.yaml') }}" >> "$GITHUB_OUTPUT"
Expand All @@ -41,20 +44,13 @@ jobs:
needs: cache
name: Prepare
steps:
- name: Check out committed code
uses: actions/checkout@v4
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Create or reuse cache
- name: Prepare code checkout and python/pre-commit setup
id: cache-reuse
uses: ./.github/actions/restore-venv
uses: plugwise/gh-actions/prepare-python-and-code@v1
with:
cache-key: ${{ needs.cache.outputs.cache-key }}
fail-on-miss: false # First time create cache (if not already exists)
python-version: ${{ steps.python.outputs.python-version }}
fail-on-miss: false # First time create cache (if not already exists)
python-version: ${{ env.DEFAULT_PYTHON }}
venv-dir: ${{ env.VENV }}
precommit-home: ${{ env.PRE_COMMIT_HOME }}

Expand All @@ -69,17 +65,12 @@ jobs:
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Create or reuse cache
- name: Restore cached environment
id: cache-reuse
uses: ./.github/actions/restore-venv
uses: plugwise/gh-actions/restore-venv@v1
with:
cache-key: ${{ needs.cache.outputs.cache-key }}
python-version: ${{ steps.python.outputs.python-version }}
python-version: ${{ env.DEFAULT_PYTHON }}
venv-dir: ${{ env.VENV }}
precommit-home: ${{ env.PRE_COMMIT_HOME }}
- name: Ruff (with fix)
Expand Down Expand Up @@ -110,17 +101,12 @@ jobs:
steps:
- name: Check out committed code
uses: actions/checkout@v4
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Create or reuse cache
- name: Restore cached environment
id: cache-reuse
uses: ./.github/actions/restore-venv
uses: plugwise/gh-actions/restore-venv@v1
with:
cache-key: ${{ needs.cache.outputs.cache-key }}
python-version: ${{ steps.python.outputs.python-version }}
python-version: ${{ env.DEFAULT_PYTHON }}
venv-dir: ${{ env.VENV }}
precommit-home: ${{ env.PRE_COMMIT_HOME }}
- name: Verify commit
Expand Down Expand Up @@ -150,18 +136,12 @@ jobs:
steps:
- name: Check out committed code
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
id: python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Create or reuse cache
- name: Restore cached environment
id: cache-reuse
uses: ./.github/actions/restore-venv
uses: plugwise/gh-actions/restore-venv@v1
with:
cache-key: ${{ needs.cache.outputs.cache-key }}-pytest-matrix-${{ matrix.python-version }}
fail-on-miss: false # First time create cache (if not already exists)
python-version: ${{ matrix.python-version }}
cache-key: ${{ needs.cache.outputs.cache-key }}
python-version: ${{ env.DEFAULT_PYTHON }}
venv-dir: ${{ env.VENV }}
precommit-home: ${{ env.PRE_COMMIT_HOME }}
- name: Run all tests
Expand All @@ -188,17 +168,12 @@ jobs:
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Create or reuse cache
- name: Restore cached environment
id: cache-reuse
uses: ./.github/actions/restore-venv
uses: plugwise/gh-actions/restore-venv@v1
with:
cache-key: ${{ needs.cache.outputs.cache-key }}
python-version: ${{ steps.python.outputs.python-version }}
python-version: ${{ env.DEFAULT_PYTHON }}
venv-dir: ${{ env.VENV }}
precommit-home: ${{ env.PRE_COMMIT_HOME }}
- name: Run mypy
Expand Down Expand Up @@ -238,17 +213,12 @@ jobs:
steps:
- name: Check out committed code
uses: actions/checkout@v4
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Create or reuse cache
- name: Restore cached environment
id: cache-reuse
uses: ./.github/actions/restore-venv
uses: plugwise/gh-actions/restore-venv@v1
with:
cache-key: ${{ needs.cache.outputs.cache-key }}
python-version: ${{ steps.python.outputs.python-version }}
python-version: ${{ env.DEFAULT_PYTHON }}
venv-dir: ${{ env.VENV }}
precommit-home: ${{ env.PRE_COMMIT_HOME }}
- name: Download all coverage artifacts
Expand All @@ -275,17 +245,12 @@ jobs:
steps:
- name: Check out committed code
uses: actions/checkout@v4
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Create or reuse cache
- name: Restore cached environment
id: cache-reuse
uses: ./.github/actions/restore-venv
uses: plugwise/gh-actions/restore-venv@v1
with:
cache-key: ${{ needs.cache.outputs.cache-key }}
python-version: ${{ steps.python.outputs.python-version }}
python-version: ${{ env.DEFAULT_PYTHON }}
venv-dir: ${{ env.VENV }}
precommit-home: ${{ env.PRE_COMMIT_HOME }}
- name: Install pypa/build
Expand Down Expand Up @@ -314,17 +279,12 @@ jobs:
steps:
- name: Check out committed code
uses: actions/checkout@v4
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Create or reuse cache
- name: Restore cached environment
id: cache-reuse
uses: ./.github/actions/restore-venv
uses: plugwise/gh-actions/restore-venv@v1
with:
cache-key: ${{ needs.cache.outputs.cache-key }}
python-version: ${{ steps.python.outputs.python-version }}
python-version: ${{ env.DEFAULT_PYTHON }}
venv-dir: ${{ env.VENV }}
precommit-home: ${{ env.PRE_COMMIT_HOME }}
- name: Run complexity report (click to view details)
Expand Down
Loading