Skip to content

Commit f58b155

Browse files
committed
restore skipping ci cache
1 parent 36b433e commit f58b155

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

ci/praktika/native_jobs.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import platform
2+
import os
23
import sys
34
import traceback
45
from typing import Dict
@@ -359,7 +360,12 @@ def _check_db(workflow):
359360
)
360361
)
361362

362-
if workflow.enable_job_filtering_by_changes and results[-1].is_ok():
363+
pr_allows_cache = "[x] <!---no_ci_cache" not in Info().pr_body
364+
if (
365+
workflow.enable_job_filtering_by_changes
366+
and results[-1].is_ok()
367+
and pr_allows_cache
368+
):
363369
print("Filter not affected jobs")
364370

365371
def check_affected_jobs():
@@ -440,6 +446,11 @@ def check_affected_jobs():
440446
)
441447

442448
if results[-1].is_ok() and workflow.enable_cache:
449+
# We can't safely skip this code block entirely if enable_cache=True is set at the workflow level
450+
# set DISABLE_CI_CACHE=1 to signal that the cache should be skipped
451+
if not pr_allows_cache:
452+
os.environ["DISABLE_CI_CACHE"] = "1"
453+
443454
print("Cache Lookup")
444455
stop_watch = Utils.Stopwatch()
445456
info = ""

0 commit comments

Comments
 (0)