summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKirill Rysin <[email protected]>2025-04-09 22:47:44 +0200
committerGitHub <[email protected]>2025-04-09 23:47:44 +0300
commit5854f4a66d2dc114dee493277adc541860195de9 (patch)
treea4a6abe3ae02e988e49263ea67fb121fe3cf6c50
parent8f777ea05c277de5b97195d2f5416679655b1312 (diff)
Github workflows: Fix Regression runs multibranch support (#17008)
-rw-r--r--.github/actions/build_and_test_ya/action.yml23
-rw-r--r--.github/workflows/regression_run.yml2
-rw-r--r--.github/workflows/regression_run_compatibility.yml2
-rw-r--r--.github/workflows/regression_run_large.yml2
-rw-r--r--.github/workflows/regression_run_small_medium.yml2
-rw-r--r--.github/workflows/run_tests.yml11
6 files changed, 27 insertions, 15 deletions
diff --git a/.github/actions/build_and_test_ya/action.yml b/.github/actions/build_and_test_ya/action.yml
index 993e3c32452..e142a282b8b 100644
--- a/.github/actions/build_and_test_ya/action.yml
+++ b/.github/actions/build_and_test_ya/action.yml
@@ -61,6 +61,27 @@ defaults:
runs:
using: "composite"
steps:
+ - name: Prepare folder prefix
+ id: prepare_prefix
+ shell: bash
+ run: |
+ # Check if custom_branch_name is set and not empty
+ if [ -n "${{ inputs.custom_branch_name }}" ]; then
+ # Extract and sanitize custom_branch_name
+ CUSTOM_BRANCH_NAME="${{ inputs.custom_branch_name }}"
+ # Replace all unsupported characters with hyphens
+ SANITIZED_NAME="${CUSTOM_BRANCH_NAME//[^a-zA-Z0-9-]/-}"
+ # Optionally limit the length to, say, 50 characters
+ SANITIZED_NAME="${SANITIZED_NAME:0:50}"
+ # Assign the sanitized name to the folder_prefix
+ FOLDER_PREFIX="ya-${SANITIZED_NAME}-"
+ else
+ # If the branch name is not provided, use a default prefix
+ FOLDER_PREFIX='ya-'
+ fi
+ # Output the folder_prefix for use in subsequent steps
+ echo "folder_prefix=${FOLDER_PREFIX}" >> $GITHUB_ENV
+
- name: Prepare s3cmd
uses: ./.github/actions/s3cmd
with:
@@ -68,7 +89,7 @@ runs:
s3_endpoint: ${{ fromJSON( inputs.vars ).AWS_ENDPOINT }}
s3_key_id: ${{ fromJSON( inputs.secs ).AWS_KEY_ID }}
s3_key_secret: ${{ fromJSON( inputs.secs ).AWS_KEY_VALUE }}
- folder_prefix: ya-
+ folder_prefix: ${{ env.folder_prefix }}
build_preset: ${{ inputs.build_preset }}
- name: Run build and tests
diff --git a/.github/workflows/regression_run.yml b/.github/workflows/regression_run.yml
index 9feadcbd7fc..831bd1983f4 100644
--- a/.github/workflows/regression_run.yml
+++ b/.github/workflows/regression_run.yml
@@ -22,5 +22,5 @@ jobs:
build_preset: ["relwithdebinfo", "release-asan", "release-tsan", "release-msan"]
with:
test_targets: ydb/
- branches: ${{ inputs.use_default_branches == true && '["main", "stable-25-1", "stable-25-1-1", "stable-25-1-analytics"]' || github.ref_name }}
+ branches: ${{ (inputs.use_default_branches == true || github.event_name == 'schedule') && '["main", "stable-25-1", "stable-25-1-1", "stable-25-1-analytics"]' || github.ref_name }}
build_preset: ${{ matrix.build_preset }} \ No newline at end of file
diff --git a/.github/workflows/regression_run_compatibility.yml b/.github/workflows/regression_run_compatibility.yml
index 765ce5de05c..3d05e8cb96f 100644
--- a/.github/workflows/regression_run_compatibility.yml
+++ b/.github/workflows/regression_run_compatibility.yml
@@ -22,5 +22,5 @@ jobs:
build_preset: ["relwithdebinfo", "release-asan", "release-tsan", "release-msan"]
with:
test_targets: ydb/tests/functional/compatibility/
- branches: ${{ inputs.use_default_branches == true && '["main", "stable-25-1", "stable-25-1-1"]' || github.ref_name }}
+ branches: ${{ (inputs.use_default_branches == true || github.event_name == 'schedule') && '["main", "stable-25-1", "stable-25-1-1"]' || github.ref_name }}
build_preset: ${{ matrix.build_preset }} \ No newline at end of file
diff --git a/.github/workflows/regression_run_large.yml b/.github/workflows/regression_run_large.yml
index 008bfe56f61..3da0bdd8b3f 100644
--- a/.github/workflows/regression_run_large.yml
+++ b/.github/workflows/regression_run_large.yml
@@ -23,5 +23,5 @@ jobs:
with:
test_targets: ydb/
test_size: large
- branches: ${{ inputs.use_default_branches == true && '["main", "stable-25-1", "stable-25-1-1"]' || github.ref_name }}
+ branches: ${{ (inputs.use_default_branches == true || github.event_name == 'schedule') && '["main", "stable-25-1", "stable-25-1-1"]' || github.ref_name }}
build_preset: ${{ matrix.build_preset }}
diff --git a/.github/workflows/regression_run_small_medium.yml b/.github/workflows/regression_run_small_medium.yml
index b13b9cf849c..d0809db6a9e 100644
--- a/.github/workflows/regression_run_small_medium.yml
+++ b/.github/workflows/regression_run_small_medium.yml
@@ -23,5 +23,5 @@ jobs:
with:
test_targets: ydb/
test_size: small,medium
- branches: ${{ inputs.use_default_branches== true && '["main", "stable-25-1", "stable-25-1-1"]' || github.ref_name }}
+ branches: ${{ (inputs.use_default_branches == true || github.event_name == 'schedule') && '["main", "stable-25-1", "stable-25-1-1"]' || github.ref_name }}
build_preset: ${{ matrix.build_preset }}
diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml
index a4aa66e4c96..bfef0ec5039 100644
--- a/.github/workflows/run_tests.yml
+++ b/.github/workflows/run_tests.yml
@@ -3,11 +3,6 @@ name: Run tests
on:
workflow_call:
inputs:
- runner_label:
- description: 'Label of the runner to be used'
- required: false
- type: string
- default: self-hosted
test_targets:
description: 'Paths to tests for run ,example : ydb/ ydb/tests/func/suite'
required: true
@@ -40,10 +35,6 @@ on:
workflow_dispatch:
inputs:
- runner_label:
- description: 'Label of the runner to be used'
- required: false
- default: self-hosted
test_targets:
description: 'Paths to tests for run ,example : ydb/ ydb/tests/func/suite'
required: true
@@ -106,7 +97,7 @@ jobs:
needs: prepare
name: ${{ matrix.branch }}:${{ inputs.build_preset }}
timeout-minutes: 1200
- runs-on: ${{ inputs.runner_label }}
+ runs-on: [ self-hosted, auto-provisioned, "${{ format('build-preset-{0}', inputs.build_preset) }}" ]
strategy:
fail-fast: false
matrix: