Skip to content
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
250c840
Fix biome url
CoMPaTech Jun 18, 2025
51ee340
Add inheritance of prepare to maintain cache
CoMPaTech Jun 18, 2025
4cbc0e3
Add pytest-cov
CoMPaTech Jun 18, 2025
93f1d83
Hash correctly
CoMPaTech Jun 18, 2025
65948b9
Less copy/pasting
CoMPaTech Jun 18, 2025
6f2c609
Wrong dir
CoMPaTech Jun 18, 2025
d4ca86e
Rework cache init
CoMPaTech Jun 18, 2025
c4bc9ac
pytest uses other versioning
CoMPaTech Jun 18, 2025
96d4d15
pytest uses other versioning
CoMPaTech Jun 18, 2025
779123a
Ensure saving
CoMPaTech Jun 18, 2025
fe7f78d
Include requirements for matrix building + single-build for default
CoMPaTech Jun 18, 2025
b030ce5
Include requirements for matrix building + single-build for default
CoMPaTech Jun 18, 2025
ef0bbe2
Include requirements for matrix building + single-build for default
CoMPaTech Jun 18, 2025
73a9fca
Include requirements for matrix building + single-build for default
CoMPaTech Jun 18, 2025
b1cb78f
Include requirements for matrix building + single-build for default
CoMPaTech Jun 18, 2025
aed710d
Improve cache usage
CoMPaTech Jun 18, 2025
2275d7b
Tidy up / fix broken publish
CoMPaTech Jun 18, 2025
776147b
Tidy up / fix broken publish
CoMPaTech Jun 18, 2025
83ff43c
Tidy up / fix broken publish
CoMPaTech Jun 18, 2025
1c960d7
Dependency
CoMPaTech Jun 18, 2025
1941dd8
Rework env variables
CoMPaTech Jun 18, 2025
1bbdd41
Rework env variables
CoMPaTech Jun 18, 2025
f549de6
Rework env variables - missing line
CoMPaTech Jun 18, 2025
741647d
Rework env variables - typo
CoMPaTech Jun 18, 2025
a958174
Rework env variables, ingest generated key
CoMPaTech Jun 18, 2025
48fa433
Try caching pre-commit install and bump cache
CoMPaTech Jun 18, 2025
6573379
Try caching pre-commit install and bump cache - change dir
CoMPaTech Jun 18, 2025
87be92e
Bump changelog, mostly to check cache re-usage
CoMPaTech Jun 18, 2025
954cd87
Cleanup
CoMPaTech Jun 18, 2025
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
56 changes: 56 additions & 0 deletions .github/actions/restore-venv/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: "Restore venv and pre-commit from cache"
description: "Restores the venv and pre-commit cache or fails"

inputs:
python-version:
required: false
default: "${{ env.DEFAULT_PYTHON }}"
cache-key:
required: true
fail-on-miss:
required: false
default: "true" # DefauLt fail if not available

runs:
using: "composite"
steps:
- name: Create or reuse cache
id: cache-create
uses: actions/cache@v4
with:
path: |
${{ env.VENV }}
${{ env.PRE_COMMIT_HOME }}
key: ${{ inputs.cache-key }}
- name: Create Python virtual environment
if: ${{ steps.cache-create.outputs.cache-hit != 'true' }}
shell: bash
run: |
pip install virtualenv --upgrade
python -m venv venv
. venv/bin/activate
pip install uv
uv pip install -U pip setuptools wheel
# 20220124 Mimic setup_test.sh
uv pip install --upgrade -r requirements_commit.txt -r requirements_test.txt -c https://raw.githubusercontent.com/home-assistant/core/dev/homeassistant/package_constraints.txt -r https://raw.githubusercontent.com/home-assistant/core/dev/requirements_test.txt -r https://raw.githubusercontent.com/home-assistant/core/dev/requirements_test_pre_commit.txt
uv pip install --upgrade pytest-asyncio
- name: Install pre-commit dependencies
if: ${{ steps.cache-create.outputs.cache-hit != 'true' }}
shell: bash
run: |
. venv/bin/activate
pre-commit install-hooks
- name: Save cache if (purposely) created
if: ${{ inputs.fail-on-miss == 'false' && steps.cache-create.outputs.cache-hit != 'true' }}
uses: actions/cache/save@v4
with:
key: ${{ inputs.cache-key }}
path: |
${{ inputs.venv-directory }}
${{ inputs.precommit-home }}
- name: Fail job if Python cache restore failed
if: ${{ inputs.fail-on-miss == 'true' && steps.cache-create.outputs.cache-hit != 'true' }}
shell: bash
run: |
echo "Failed to restore cache for ${{ inputs.python-version}} virtual environment from cache"
exit 1
30 changes: 30 additions & 0 deletions .github/workflows/restore-venv/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: "Restore venv and pre-commit from cache"
description: "Restores the venv and pre-commit cache or fails"

runs:
using: "composite"
steps:
- name: Create or reuse cache
id: cache-create
uses: actions/cache@v4
with:
path: |
${{ inputs.venv-directory }}
${{ inputs.precommit-home }}
key: ${{ inputs.cache-key }}
- name: Fail job if Python cache restore failed
if: steps.cache-create.outputs.cache-hit != 'true'
shell: bash
run: |
echo "Failed to restore cache for {{ inputs.python-version}} virtual environment from cache"
exit 1

inputs:
python-version:
required: true
cache-key:
required: true
venv-directory:
required: true
precommit-home:
required: true
Loading
Loading