Skip to content

Commit fe7f78d

Browse files
committed
Include requirements for matrix building + single-build for default
1 parent 779123a commit fe7f78d

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

.github/actions/restore-venv/action.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,16 @@ runs:
2525
${{ inputs.venv-directory }}
2626
${{ inputs.precommit-home }}
2727
key: ${{ inputs.cache-key }}
28+
- name: Create Python virtual environment
29+
run: |
30+
pip install virtualenv --upgrade
31+
python -m venv venv
32+
. venv/bin/activate
33+
pip install uv
34+
uv pip install -U pip setuptools wheel
35+
# 20220124 Mimic setup_test.sh
36+
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
37+
uv pip install --upgrade pytest-asyncio
2838
- name: Save cache if (purposely) created
2939
if: ${{ inputs.fail-on-miss == 'false' && steps.cache-venv.outputs.cache-hit != 'true' }}
3040
uses: actions/cache/save@v4

.github/workflows/verify.yml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,6 @@ jobs:
3838
venv-directory: ${{ env.VENV }}
3939
precommit-home: ${{ env.PRE_COMMIT_HOME }}
4040
fail-on-miss: false # First time create cache (if not already exists)
41-
- name: Create Python virtual environment
42-
run: |
43-
pip install virtualenv --upgrade
44-
python -m venv venv
45-
. venv/bin/activate
46-
pip install uv
47-
uv pip install -U pip setuptools wheel
48-
# 20220124 Mimic setup_test.sh
49-
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
50-
uv pip install --upgrade pytest-asyncio
5141
- name: Install pre-commit dependencies
5242
run: |
5343
. venv/bin/activate
@@ -134,6 +124,7 @@ jobs:
134124
name: Run pytest using Python ${{ matrix.python-version }}
135125
needs:
136126
- prepare
127+
- commitcheck
137128
strategy:
138129
matrix:
139130
python-version: ["3.13"]
@@ -150,7 +141,7 @@ jobs:
150141
uses: ./.github/actions/restore-venv
151142
with:
152143
python-version: ${{ matrix.python-version }}
153-
cache-key: ${{ runner.os }}-venv-cache-${{ env.CACHE_VERSION }}-${{ matrix.python--version }}-${{ hashFiles('pyproject.toml', 'requirements_test.txt', '.pre-commit-config.yaml') }}
144+
cache-key: ${{ runner.os }}-venv-cache-${{ env.CACHE_VERSION }}-matrix-${{ matrix.python--version }}-${{ hashFiles('pyproject.toml', 'requirements_test.txt', '.pre-commit-config.yaml') }}
154145
venv-directory: ${{ env.VENV }}
155146
precommit-home: ${{ env.PRE_COMMIT_HOME }}
156147
fail-on-miss: false # First time create cache (if not already exists)
@@ -173,6 +164,7 @@ jobs:
173164
needs:
174165
- prepare
175166
- pytest
167+
- coverage
176168
steps:
177169
- name: Check out committed code
178170
uses: actions/checkout@v4
@@ -222,6 +214,7 @@ jobs:
222214
runs-on: ubuntu-latest
223215
needs:
224216
- prepare
217+
- mypy
225218
- pytest
226219
steps:
227220
- name: Check out committed code
@@ -260,7 +253,10 @@ jobs:
260253
test-publishing:
261254
name: Build and publish Python 🐍 distributions 📦 to TestPyPI
262255
runs-on: ubuntu-latest
263-
needs: [coverage, mypy]
256+
needs:
257+
- prepare
258+
- coverage
259+
- mypy
264260
steps:
265261
- name: Check out committed code
266262
uses: actions/checkout@v4

0 commit comments

Comments
 (0)