Skip to content

Commit 80252ab

Browse files
committed
ci: simplify venv cache key and consolidate poetry env
Three trims: 1. Drop ${{ env.ImageOS }}-${{ env.ImageVersion }}- from both cache keys. env context only resolves workflow-declared env vars, not runner process env vars like ImageOS / ImageVersion, so these interpolations were silently empty (visible in dbus-fast's post-merge logs of the same pattern). 2. Merge the two hashFiles() calls into one covering poetry.lock, pyproject.toml, build_ext.py, src/zeroconf/**/*.py, and src/zeroconf/**/*.pxd. Concatenated either way; one call is easier to read. 3. Promote POETRY_VIRTUALENVS_IN_PROJECT to workflow-level env: instead of duplicating on the test and benchmark jobs.
1 parent 101110d commit 80252ab

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

.github/workflows/ci.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ concurrency:
1111
group: ${{ github.head_ref || github.run_id }}
1212
cancel-in-progress: true
1313

14+
env:
15+
POETRY_VIRTUALENVS_IN_PROJECT: "true"
16+
1417
jobs:
1518
lint:
1619
runs-on: ubuntu-latest
@@ -75,8 +78,6 @@ jobs:
7578
- os: macos-latest
7679
python-version: "pypy-3.10"
7780
runs-on: ${{ matrix.os }}
78-
env:
79-
POETRY_VIRTUALENVS_IN_PROJECT: "true"
8081
steps:
8182
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
8283
- name: Set up uv
@@ -98,7 +99,7 @@ jobs:
9899
path: |
99100
.venv
100101
src/zeroconf/**/*.so
101-
key: venv-v1-${{ runner.os }}-${{ env.ImageOS }}-${{ env.ImageVersion }}-py${{ matrix.python-version }}-${{ matrix.extension }}-${{ hashFiles('poetry.lock', 'pyproject.toml', 'build_ext.py') }}-${{ hashFiles('src/zeroconf/**/*.py', 'src/zeroconf/**/*.pxd') }}
102+
key: venv-v1-${{ runner.os }}-py${{ matrix.python-version }}-${{ matrix.extension }}-${{ hashFiles('poetry.lock', 'pyproject.toml', 'build_ext.py', 'src/zeroconf/**/*.py', 'src/zeroconf/**/*.pxd') }}
102103
- name: Install Dependencies no cython
103104
if: ${{ matrix.extension == 'skip_cython' && steps.cache-venv.outputs.cache-hit != 'true' }}
104105
env:
@@ -118,8 +119,6 @@ jobs:
118119

119120
benchmark:
120121
runs-on: ubuntu-latest
121-
env:
122-
POETRY_VIRTUALENVS_IN_PROJECT: "true"
123122
steps:
124123
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
125124
- name: Setup Python 3.13
@@ -139,7 +138,7 @@ jobs:
139138
path: |
140139
.venv
141140
src/zeroconf/**/*.so
142-
key: venv-v1-${{ runner.os }}-${{ env.ImageOS }}-${{ env.ImageVersion }}-benchmark-py3.13-${{ hashFiles('poetry.lock', 'pyproject.toml', 'build_ext.py') }}-${{ hashFiles('src/zeroconf/**/*.py', 'src/zeroconf/**/*.pxd') }}
141+
key: venv-v1-${{ runner.os }}-benchmark-py3.13-${{ hashFiles('poetry.lock', 'pyproject.toml', 'build_ext.py', 'src/zeroconf/**/*.py', 'src/zeroconf/**/*.pxd') }}
143142
- name: Install Dependencies
144143
if: steps.cache-venv.outputs.cache-hit != 'true'
145144
run: |

0 commit comments

Comments
 (0)