Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 26 additions & 10 deletions .github/workflows/nightly_build.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,43 @@
name: Nightly-Build # workflow used to upload built binaries to s3
on:
schedule:
- cron: "0 3 * * *" # At 03:00 every day
workflow_dispatch:
inputs:
runner_label:
type: string
default: "auto-provisioned"
description: "runner label"
commit_sha:
type: string
default: ""
use_default_branches:
description: 'If true, run on main and all current stable branches. If false, run only on the current branch.'
type: boolean
required: false
default: true

jobs:
determine_branches:
runs-on: ubuntu-latest
outputs:
branches: ${{ steps.set-branches.outputs.branches }}
steps:
- id: set-branches
run: |
if [[ "${{ github.event_name }}" == "schedule" || "${{ inputs.use_default_branches }}" == "true" ]]; then
echo "branches=['main', 'stable-25-1', 'stable-24-4', 'stable-25-1-1', 'stable-25-1-analytics']" >> $GITHUB_OUTPUT
else
echo "branches=['${{ github.ref_name }}']" >> $GITHUB_OUTPUT
fi

build_and_test:
needs: determine_branches
strategy:
fail-fast: false
matrix:
build_preset: ["release", "relwithdebinfo", "release-asan"]
branch: ${{ fromJSON(needs.determine_branches.outputs.branches) }}
runs-on: [ self-hosted, auto-provisioned, "${{ format('build-preset-{0}', matrix.build_preset) }}" ]
name: Build and test ${{ matrix.build_preset }}
name: Build and test ${{ matrix.build_preset }} on ${{ matrix.branch }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.commit_sha }}
ref: ${{ matrix.branch }}
fetch-depth: 2
- name: Setup ydb access
uses: ./.github/actions/setup_ci_ydb_service_account_key_file_credentials
Expand Down Expand Up @@ -51,4 +67,4 @@ jobs:
shell: bash
run: |
set -x
s3cmd sync --follow-symlinks --acl-public --no-progress --stats --no-check-md5 "ydb/apps/ydbd/ydbd" "s3://ydb-builds/${{ github.ref_name }}/${{ matrix.build_preset }}/ydbd" -d
s3cmd sync --follow-symlinks --acl-public --no-progress --stats --no-check-md5 "ydb/apps/ydbd/ydbd" "s3://ydb-builds/${{ matrix.branch }}/${{ matrix.build_preset }}/ydbd" -d
30 changes: 18 additions & 12 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run tests
name: Run-tests

on:
workflow_call:
Expand Down Expand Up @@ -68,10 +68,6 @@ on:
- release-msan
- release-tsan
default: relwithdebinfo
branches:
description: 'Branches to test (JSON array or single branch name)'
required: false
default: '["main"]'

jobs:
prepare:
Expand All @@ -81,17 +77,27 @@ jobs:
steps:
- name: Set branches
id: set-branches
env:
CALLED_BRANCHES: '${{ inputs.branches }}'
run: |
INPUT_BRANCHES='${{ inputs.branches }}'
# Check if input is a JSON array
if [[ $INPUT_BRANCHES == \[* ]]; then
echo "branch_array=$INPUT_BRANCHES" >> $GITHUB_OUTPUT
# Проверяем, был ли передан параметр branches из вызывающего workflow
if [[ -n "$CALLED_BRANCHES" ]]; then
echo "Branches parameter provided from calling workflow: $CALLED_BRANCHES"

# Проверяем, является ли вход уже JSON-массивом
if [[ $CALLED_BRANCHES == \[* ]]; then
echo "branch_array=$CALLED_BRANCHES" >> $GITHUB_OUTPUT
else
# Если это одна ветка, создаем JSON-массив с одним элементом
echo "branch_array=[\"$CALLED_BRANCHES\"]" >> $GITHUB_OUTPUT
fi
else
# If it's a single branch, create a JSON array with one element
echo "branch_array=[\"$INPUT_BRANCHES\"]" >> $GITHUB_OUTPUT
# Если ветки не переданы, значит это прямой запуск workflow_dispatch
echo "No branches specified, using current branch: ${{ github.ref_name }}"
echo "branch_array=[\"${{ github.ref_name }}\"]" >> $GITHUB_OUTPUT
fi

echo "Using branches: $(cat $GITHUB_OUTPUT | grep branch_array | cut -d= -f2)"
echo "Final branches to use: $(cat $GITHUB_OUTPUT | grep branch_array | cut -d= -f2)"

run_tests:
needs: prepare
Expand Down
Loading
Loading