Skip to content

Commit f2466b4

Browse files
committed
try adding disable ci cache as an input to workflow dispatch
1 parent 5ffcd9c commit f2466b4

File tree

6 files changed

+47
-4
lines changed

6 files changed

+47
-4
lines changed

.github/workflows/backport_branches.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,20 @@ name: BackportPR
44

55
on:
66
workflow_dispatch:
7+
inputs:
8+
no_cache:
9+
description: Run without cache
10+
required: false
11+
type: boolean
12+
default: false
713
pull_request:
814
branches: ['2[1-9].[1-9][0-9]', '2[1-9].[1-9]']
915

1016
env:
1117
# Force the stdout and stderr streams to be unbuffered
1218
PYTHONUNBUFFERED: 1
1319
DISABLE_CI_MERGE_COMMIT: ${{ vars.DISABLE_CI_MERGE_COMMIT || '0' }}
14-
DISABLE_CI_CACHE: ${{ vars.DISABLE_CI_CACHE || '0' }}
20+
DISABLE_CI_CACHE: ${{ github.event.inputs.no_cache || '0' }}
1521
CHECKOUT_REF: ${{ vars.DISABLE_CI_MERGE_COMMIT == '1' && github.event.pull_request.head.sha || '' }}
1622
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
1723
CLICKHOUSE_TEST_STAT_URL: ${{ secrets.CLICKHOUSE_TEST_STAT_URL }}

.github/workflows/master.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,19 @@ name: MasterCI
44

55
on:
66
workflow_dispatch:
7+
inputs:
8+
no_cache:
9+
description: Run without cache
10+
required: false
11+
type: boolean
12+
default: false
713
push:
814
branches: ['antalya', 'releases/*', 'antalya-*']
915

1016
env:
1117
# Force the stdout and stderr streams to be unbuffered
1218
PYTHONUNBUFFERED: 1
19+
DISABLE_CI_CACHE: ${{ github.event.inputs.no_cache || '0' }}
1320
CHECKOUT_REF: ""
1421
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
1522
CLICKHOUSE_TEST_STAT_URL: ${{ secrets.CLICKHOUSE_TEST_STAT_URL }}

.github/workflows/pull_request.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,20 @@ name: PR
44

55
on:
66
workflow_dispatch:
7+
inputs:
8+
no_cache:
9+
description: Run without cache
10+
required: false
11+
type: boolean
12+
default: false
713
pull_request:
814
branches: ['antalya', 'releases/*', 'antalya-*']
915

1016
env:
1117
# Force the stdout and stderr streams to be unbuffered
1218
PYTHONUNBUFFERED: 1
1319
DISABLE_CI_MERGE_COMMIT: ${{ vars.DISABLE_CI_MERGE_COMMIT || '0' }}
14-
DISABLE_CI_CACHE: ${{ vars.DISABLE_CI_CACHE || '0' }}
20+
DISABLE_CI_CACHE: ${{ github.event.inputs.no_cache || '0' }}
1521
CHECKOUT_REF: ${{ vars.DISABLE_CI_MERGE_COMMIT == '1' && github.event.pull_request.head.sha || '' }}
1622
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
1723
CLICKHOUSE_TEST_STAT_URL: ${{ secrets.CLICKHOUSE_TEST_STAT_URL }}

.github/workflows/release_branches.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,19 @@ name: ReleaseBranchCI
44

55
on:
66
workflow_dispatch:
7+
inputs:
8+
no_cache:
9+
description: Run without cache
10+
required: false
11+
type: boolean
12+
default: false
713
push:
814
branches: ['2[1-9].[1-9][0-9]', '2[1-9].[1-9]']
915

1016
env:
1117
# Force the stdout and stderr streams to be unbuffered
1218
PYTHONUNBUFFERED: 1
19+
DISABLE_CI_CACHE: ${{ github.event.inputs.no_cache || '0' }}
1320
CHECKOUT_REF: ""
1421
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
1522
CLICKHOUSE_TEST_STAT_URL: ${{ secrets.CLICKHOUSE_TEST_STAT_URL }}

ci/praktika/native_jobs.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,10 @@ def _check_db(workflow):
360360
)
361361
)
362362

363-
pr_allows_cache = "[x] <!---no_ci_cache" not in Info().pr_body
363+
pr_allows_cache = (
364+
"[x] <!---no_ci_cache" not in Info().pr_body
365+
or os.environ.get("DISABLE_CI_CACHE", "0") not in ("1", "true")
366+
)
364367
if (
365368
workflow.enable_job_filtering_by_changes
366369
and results[-1].is_ok()

ci/praktika/yaml_generator.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ class Templates:
3636
3737
on:
3838
workflow_dispatch:
39+
inputs:
40+
no_cache:
41+
description: Run without cache
42+
required: false
43+
type: boolean
44+
default: false
3945
{EVENT}:
4046
branches: [{BRANCHES}]
4147
@@ -55,8 +61,12 @@ class Templates:
5561
"""
5662
TEMPLATE_ENV_CHECKOUT_REF_PR = """\
5763
DISABLE_CI_MERGE_COMMIT: ${{{{ vars.DISABLE_CI_MERGE_COMMIT || '0' }}}}
58-
DISABLE_CI_CACHE: ${{{{ vars.DISABLE_CI_CACHE || '0' }}}}
64+
DISABLE_CI_CACHE: ${{{{ github.event.inputs.no_cache || '0' }}}}
5965
CHECKOUT_REF: ${{{{ vars.DISABLE_CI_MERGE_COMMIT == '1' && github.event.pull_request.head.sha || '' }}}}\
66+
"""
67+
TEMPLATE_ENV_CHECKOUT_REF_PUSH = """\
68+
DISABLE_CI_CACHE: ${{{{ github.event.inputs.no_cache || '0' }}}}
69+
CHECKOUT_REF: ""\
6070
"""
6171
TEMPLATE_ENV_CHECKOUT_REF_DEFAULT = """\
6272
CHECKOUT_REF: ""\
@@ -432,6 +442,10 @@ def generate(self):
432442
ENV_CHECKOUT_REFERENCE = (
433443
YamlGenerator.Templates.TEMPLATE_ENV_CHECKOUT_REF_PR
434444
)
445+
elif self.workflow_config.event in (Workflow.Event.PUSH,):
446+
ENV_CHECKOUT_REFERENCE = (
447+
YamlGenerator.Templates.TEMPLATE_ENV_CHECKOUT_REF_PUSH
448+
)
435449
else:
436450
ENV_CHECKOUT_REFERENCE = (
437451
YamlGenerator.Templates.TEMPLATE_ENV_CHECKOUT_REF_DEFAULT

0 commit comments

Comments
 (0)