2024-04-29 13:47:08 +00:00
|
|
|
# yamllint disable rule:comments-indentation
|
|
|
|
name: MergeQueueCI
|
|
|
|
|
|
|
|
env:
|
|
|
|
# Force the stdout and stderr streams to be unbuffered
|
|
|
|
PYTHONUNBUFFERED: 1
|
|
|
|
|
|
|
|
on: # yamllint disable-line rule:truthy
|
|
|
|
merge_group:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
RunConfig:
|
|
|
|
runs-on: [self-hosted, style-checker-aarch64]
|
|
|
|
outputs:
|
|
|
|
data: ${{ steps.runconfig.outputs.CI_DATA }}
|
|
|
|
steps:
|
2024-05-11 10:22:41 +00:00
|
|
|
- name: DebugInfo
|
|
|
|
uses: hmarr/debug-action@f7318c783045ac39ed9bb497e22ce835fdafbfe6
|
2024-04-29 13:47:08 +00:00
|
|
|
- name: Check out repository code
|
|
|
|
uses: ClickHouse/checkout@v1
|
|
|
|
with:
|
|
|
|
clear-repository: true # to ensure correct digests
|
2024-05-24 08:53:19 +00:00
|
|
|
fetch-depth: 0 # to get a version
|
2024-04-29 13:47:08 +00:00
|
|
|
filter: tree:0
|
2024-05-21 10:57:05 +00:00
|
|
|
- name: Cancel PR workflow
|
|
|
|
run: |
|
|
|
|
python3 "$GITHUB_WORKSPACE/tests/ci/ci.py" --cancel-previous-run
|
2024-04-29 13:47:08 +00:00
|
|
|
- name: Python unit tests
|
|
|
|
run: |
|
|
|
|
cd "$GITHUB_WORKSPACE/tests/ci"
|
|
|
|
echo "Testing the main ci directory"
|
|
|
|
python3 -m unittest discover -s . -p 'test_*.py'
|
|
|
|
- name: PrepareRunConfig
|
|
|
|
id: runconfig
|
|
|
|
run: |
|
|
|
|
python3 "$GITHUB_WORKSPACE/tests/ci/ci.py" --configure --outfile ${{ runner.temp }}/ci_run_data.json
|
|
|
|
|
|
|
|
echo "::group::CI configuration"
|
|
|
|
python3 -m json.tool ${{ runner.temp }}/ci_run_data.json
|
|
|
|
echo "::endgroup::"
|
|
|
|
|
|
|
|
{
|
|
|
|
echo 'CI_DATA<<EOF'
|
|
|
|
cat ${{ runner.temp }}/ci_run_data.json
|
|
|
|
echo 'EOF'
|
|
|
|
} >> "$GITHUB_OUTPUT"
|
|
|
|
BuildDockers:
|
|
|
|
needs: [RunConfig]
|
|
|
|
if: ${{ !failure() && !cancelled() && toJson(fromJson(needs.RunConfig.outputs.data).docker_data.missing_multi) != '[]' }}
|
2024-07-14 19:07:41 +00:00
|
|
|
uses: ./.github/workflows/docker_test_images.yml
|
2024-04-29 13:47:08 +00:00
|
|
|
with:
|
|
|
|
data: ${{ needs.RunConfig.outputs.data }}
|
|
|
|
StyleCheck:
|
|
|
|
needs: [RunConfig, BuildDockers]
|
|
|
|
if: ${{ !failure() && !cancelled() && contains(fromJson(needs.RunConfig.outputs.data).jobs_data.jobs_to_do, 'Style check')}}
|
|
|
|
uses: ./.github/workflows/reusable_test.yml
|
|
|
|
with:
|
|
|
|
test_name: Style check
|
2024-05-24 08:53:19 +00:00
|
|
|
runner_type: style-checker-aarch64
|
2024-04-29 13:47:08 +00:00
|
|
|
run_command: |
|
|
|
|
python3 style_check.py
|
|
|
|
data: ${{ needs.RunConfig.outputs.data }}
|
|
|
|
secrets:
|
|
|
|
secret_envs: |
|
|
|
|
ROBOT_CLICKHOUSE_SSH_KEY<<RCSK
|
|
|
|
${{secrets.ROBOT_CLICKHOUSE_SSH_KEY}}
|
|
|
|
RCSK
|
|
|
|
FastTest:
|
|
|
|
needs: [RunConfig, BuildDockers]
|
|
|
|
if: ${{ !failure() && !cancelled() && contains(fromJson(needs.RunConfig.outputs.data).jobs_data.jobs_to_do, 'Fast test') }}
|
|
|
|
uses: ./.github/workflows/reusable_test.yml
|
|
|
|
with:
|
|
|
|
test_name: Fast test
|
|
|
|
runner_type: builder
|
|
|
|
data: ${{ needs.RunConfig.outputs.data }}
|
|
|
|
run_command: |
|
|
|
|
python3 fast_test_check.py
|
|
|
|
|
2024-05-31 14:40:23 +00:00
|
|
|
Builds_1:
|
|
|
|
needs: [RunConfig, BuildDockers]
|
|
|
|
if: ${{ !failure() && !cancelled() && contains(fromJson(needs.RunConfig.outputs.data).stages_data.stages_to_do, 'Builds_1') }}
|
|
|
|
# using callable wf (reusable_stage.yml) allows grouping all nested jobs under a tab
|
|
|
|
uses: ./.github/workflows/reusable_build_stage.yml
|
|
|
|
with:
|
|
|
|
stage: Builds_1
|
|
|
|
data: ${{ needs.RunConfig.outputs.data }}
|
|
|
|
Tests_1:
|
|
|
|
needs: [RunConfig, Builds_1]
|
|
|
|
if: ${{ !failure() && !cancelled() && contains(fromJson(needs.RunConfig.outputs.data).stages_data.stages_to_do, 'Tests_1') }}
|
|
|
|
uses: ./.github/workflows/reusable_test_stage.yml
|
|
|
|
with:
|
|
|
|
stage: Tests_1
|
|
|
|
data: ${{ needs.RunConfig.outputs.data }}
|
|
|
|
|
2024-06-25 13:22:01 +00:00
|
|
|
CheckReadyForMerge:
|
2024-07-22 13:46:27 +00:00
|
|
|
if: ${{ !cancelled() }}
|
2024-06-25 13:22:01 +00:00
|
|
|
# Test_2 or Test_3 must not have jobs required for Mergeable check
|
2024-05-31 14:40:23 +00:00
|
|
|
needs: [RunConfig, BuildDockers, StyleCheck, FastTest, Builds_1, Tests_1]
|
2024-05-24 08:53:19 +00:00
|
|
|
runs-on: [self-hosted, style-checker-aarch64]
|
2024-04-29 13:47:08 +00:00
|
|
|
steps:
|
|
|
|
- name: Check out repository code
|
|
|
|
uses: ClickHouse/checkout@v1
|
2024-06-25 13:22:01 +00:00
|
|
|
- name: Check and set merge status
|
2024-07-22 13:46:27 +00:00
|
|
|
if: ${{ needs.StyleCheck.result == 'success' }}
|
2024-04-29 13:47:08 +00:00
|
|
|
run: |
|
|
|
|
cd "$GITHUB_WORKSPACE/tests/ci"
|
2024-06-25 13:22:01 +00:00
|
|
|
python3 merge_pr.py --set-ci-status --wf-status ${{ contains(needs.*.result, 'failure') && 'failure' || 'success' }}
|
2024-07-22 13:46:27 +00:00
|
|
|
- name: Check Workflow results
|
|
|
|
run: |
|
|
|
|
export WORKFLOW_RESULT_FILE="/tmp/workflow_results.json"
|
2024-07-24 07:32:51 +00:00
|
|
|
cat > "$WORKFLOW_RESULT_FILE" << 'EOF'
|
2024-07-22 13:46:27 +00:00
|
|
|
${{ toJson(needs) }}
|
|
|
|
EOF
|
|
|
|
python3 ./tests/ci/ci_buddy.py --check-wf-status
|