Skip to content

Commit 093b27f

Browse files
Harden primer package caching against possible race condition
Refs #9925 (comment)
1 parent 67acc96 commit 093b27f

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.github/workflows/primer_run_main.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,10 @@ jobs:
7878
${{ runner.os }}-${{ matrix.python-version }}-${{
7979
steps.commitstring.outputs.commitstring }}-primer
8080
- name: Regenerate cache
81-
if: steps.cache-projects.outputs.cache-hit != 'true'
81+
# Presence of colorama is a heuristic for the env having all packages
82+
if:
83+
steps.cache-projects.outputs.cache-hit != 'true' || (. venv/bin/activate && !
84+
python -m pip show colorama)
8285
run: |
8386
. venv/bin/activate
8487
python tests/primer/__main__.py prepare --clone

.github/workflows/primer_run_pr.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,10 @@ jobs:
147147
${{ runner.os }}-${{ matrix.python-version }}-${{
148148
steps.commitstring.outputs.commitstring }}-primer
149149
- name: Regenerate cache
150-
if: steps.cache-projects.outputs.cache-hit != 'true'
150+
# Presence of colorama is a heuristic for the env having all packages
151+
if:
152+
steps.cache-projects.outputs.cache-hit != 'true' || (. venv/bin/activate && !
153+
python -m pip show colorama)
151154
run: |
152155
. venv/bin/activate
153156
python tests/primer/__main__.py prepare --clone

0 commit comments

Comments
 (0)