2023-11-06 17:59:13 +00:00
|
|
|
# yamllint disable rule:comments-indentation
|
2021-11-22 11:54:02 +00:00
|
|
|
name: MasterCI
|
2021-12-15 19:47:08 +00:00
|
|
|
|
|
|
|
env:
|
|
|
|
# Force the stdout and stderr streams to be unbuffered
|
|
|
|
PYTHONUNBUFFERED: 1
|
|
|
|
|
2021-11-22 11:54:02 +00:00
|
|
|
on: # yamllint disable-line rule:truthy
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- 'master'
|
|
|
|
jobs:
|
2023-12-18 08:07:22 +00:00
|
|
|
RunConfig:
|
2024-02-21 16:59:41 +00:00
|
|
|
runs-on: [self-hosted, style-checker-aarch64]
|
2023-12-18 08:07:22 +00:00
|
|
|
outputs:
|
|
|
|
data: ${{ steps.runconfig.outputs.CI_DATA }}
|
2022-01-18 21:33:53 +00:00
|
|
|
steps:
|
|
|
|
- name: Check out repository code
|
2022-12-23 16:54:19 +00:00
|
|
|
uses: ClickHouse/checkout@v1
|
2022-12-20 10:34:56 +00:00
|
|
|
with:
|
2023-12-18 08:07:22 +00:00
|
|
|
clear-repository: true # to ensure correct digests
|
2023-12-18 16:06:10 +00:00
|
|
|
fetch-depth: 0 # to get version
|
|
|
|
filter: tree:0
|
2024-09-16 12:22:56 +00:00
|
|
|
- name: Debug Info
|
|
|
|
uses: ./.github/actions/debug
|
2024-04-11 11:58:44 +00:00
|
|
|
- name: Merge sync PR
|
2024-04-10 13:17:39 +00:00
|
|
|
run: |
|
|
|
|
cd "$GITHUB_WORKSPACE/tests/ci"
|
2024-04-11 11:58:44 +00:00
|
|
|
python3 sync_pr.py --merge || :
|
2024-05-24 09:36:28 +00:00
|
|
|
# Runs in MQ:
|
|
|
|
# - name: Python unit tests
|
|
|
|
# run: |
|
|
|
|
# cd "$GITHUB_WORKSPACE/tests/ci"
|
|
|
|
# echo "Testing the main ci directory"
|
|
|
|
# python3 -m unittest discover -s . -p 'test_*.py'
|
2023-12-18 08:07:22 +00:00
|
|
|
- name: PrepareRunConfig
|
|
|
|
id: runconfig
|
2022-01-07 13:21:30 +00:00
|
|
|
run: |
|
2024-02-02 17:10:47 +00:00
|
|
|
python3 "$GITHUB_WORKSPACE/tests/ci/ci.py" --configure --outfile ${{ runner.temp }}/ci_run_data.json
|
2023-12-18 08:07:22 +00:00
|
|
|
|
2024-01-04 15:35:09 +00:00
|
|
|
echo "::group::CI configuration"
|
2023-12-18 08:07:22 +00:00
|
|
|
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"
|
|
|
|
- name: Re-create GH statuses for skipped jobs if any
|
2023-12-15 14:48:01 +00:00
|
|
|
run: |
|
2023-12-18 08:07:22 +00:00
|
|
|
python3 "$GITHUB_WORKSPACE/tests/ci/ci.py" --infile ${{ runner.temp }}/ci_run_data.json --update-gh-statuses
|
2024-05-24 08:53:19 +00:00
|
|
|
# Runs in MQ:
|
|
|
|
# BuildDockers:
|
|
|
|
# needs: [RunConfig]
|
|
|
|
# if: ${{ !failure() && !cancelled() }}
|
2024-07-14 19:07:41 +00:00
|
|
|
# uses: ./.github/workflows/docker_test_images.yml
|
2024-05-24 08:53:19 +00:00
|
|
|
# with:
|
|
|
|
# data: ${{ needs.RunConfig.outputs.data }}
|
2024-04-25 11:24:22 +00:00
|
|
|
# StyleCheck:
|
|
|
|
# needs: [RunConfig, BuildDockers]
|
|
|
|
# if: ${{ !failure() && !cancelled() }}
|
|
|
|
# uses: ./.github/workflows/reusable_test.yml
|
|
|
|
# with:
|
|
|
|
# test_name: Style check
|
|
|
|
# runner_type: style-checker
|
|
|
|
# data: ${{ needs.RunConfig.outputs.data }}
|
|
|
|
# run_command: |
|
|
|
|
# python3 style_check.py --no-push
|
2024-05-24 08:53:19 +00:00
|
|
|
|
|
|
|
################################# Main stages #################################
|
|
|
|
# for main CI chain
|
|
|
|
#
|
|
|
|
Builds_1:
|
|
|
|
needs: [RunConfig]
|
|
|
|
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
|
2023-11-06 17:59:13 +00:00
|
|
|
with:
|
2024-05-24 08:53:19 +00:00
|
|
|
stage: Builds_1
|
2023-12-18 08:07:22 +00:00
|
|
|
data: ${{ needs.RunConfig.outputs.data }}
|
2024-05-24 08:53:19 +00:00
|
|
|
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
|
2024-05-14 08:03:32 +00:00
|
|
|
with:
|
2024-05-24 08:53:19 +00:00
|
|
|
stage: Tests_1
|
2024-05-14 08:03:32 +00:00
|
|
|
data: ${{ needs.RunConfig.outputs.data }}
|
2024-05-24 08:53:19 +00:00
|
|
|
Builds_2:
|
|
|
|
needs: [RunConfig, Builds_1]
|
|
|
|
if: ${{ !failure() && !cancelled() && contains(fromJson(needs.RunConfig.outputs.data).stages_data.stages_to_do, 'Builds_2') }}
|
|
|
|
uses: ./.github/workflows/reusable_build_stage.yml
|
2024-04-30 10:02:19 +00:00
|
|
|
with:
|
2024-05-24 08:53:19 +00:00
|
|
|
stage: Builds_2
|
2024-04-30 10:02:19 +00:00
|
|
|
data: ${{ needs.RunConfig.outputs.data }}
|
2024-07-25 10:12:37 +00:00
|
|
|
Tests_2_ww:
|
2024-05-24 08:53:19 +00:00
|
|
|
needs: [RunConfig, Builds_2]
|
2024-07-25 10:12:37 +00:00
|
|
|
if: ${{ !failure() && !cancelled() && contains(fromJson(needs.RunConfig.outputs.data).stages_data.stages_to_do, 'Tests_2_ww') }}
|
2024-05-24 08:53:19 +00:00
|
|
|
uses: ./.github/workflows/reusable_test_stage.yml
|
2023-12-18 08:07:22 +00:00
|
|
|
with:
|
2024-07-25 10:12:37 +00:00
|
|
|
stage: Tests_2_ww
|
2023-12-18 08:07:22 +00:00
|
|
|
data: ${{ needs.RunConfig.outputs.data }}
|
2024-07-25 10:12:37 +00:00
|
|
|
Tests_2:
|
2024-06-05 07:47:11 +00:00
|
|
|
# Test_3 should not wait for Test_1/Test_2 and should not be blocked by them on master branch since all jobs need to run there.
|
2024-06-18 19:59:59 +00:00
|
|
|
needs: [RunConfig, Builds_1]
|
2024-07-25 10:12:37 +00:00
|
|
|
if: ${{ !failure() && !cancelled() && contains(fromJson(needs.RunConfig.outputs.data).stages_data.stages_to_do, 'Tests_2') }}
|
2024-05-24 08:53:19 +00:00
|
|
|
uses: ./.github/workflows/reusable_test_stage.yml
|
2024-01-30 17:56:49 +00:00
|
|
|
with:
|
2024-07-25 10:12:37 +00:00
|
|
|
stage: Tests_2
|
2024-01-30 17:56:49 +00:00
|
|
|
data: ${{ needs.RunConfig.outputs.data }}
|
2024-05-24 08:53:19 +00:00
|
|
|
|
|
|
|
################################# Reports #################################
|
2024-06-10 09:18:03 +00:00
|
|
|
# Reports should run even if Builds_1/2 fail - run them separately, not in Tests_1/2/3
|
|
|
|
Builds_Report:
|
2023-12-21 20:30:40 +00:00
|
|
|
# run report check for failed builds to indicate the CI error
|
2024-06-22 11:41:14 +00:00
|
|
|
if: ${{ !cancelled() && needs.RunConfig.result == 'success' && contains(fromJson(needs.RunConfig.outputs.data).jobs_data.jobs_to_do, 'Builds') }}
|
2024-06-17 12:00:58 +00:00
|
|
|
needs: [RunConfig, Builds_1, Builds_2]
|
2023-11-12 09:12:04 +00:00
|
|
|
uses: ./.github/workflows/reusable_test.yml
|
|
|
|
with:
|
2024-06-22 11:41:14 +00:00
|
|
|
test_name: Builds
|
2024-03-01 00:48:31 +00:00
|
|
|
runner_type: style-checker-aarch64
|
2023-12-18 08:07:22 +00:00
|
|
|
data: ${{ needs.RunConfig.outputs.data }}
|
2024-05-24 08:53:19 +00:00
|
|
|
|
2021-11-22 11:54:02 +00:00
|
|
|
FinishCheck:
|
2024-05-24 09:36:28 +00:00
|
|
|
if: ${{ !cancelled() }}
|
2024-07-25 10:12:37 +00:00
|
|
|
needs: [RunConfig, Builds_1, Builds_2, Builds_Report, Tests_1, Tests_2_ww, Tests_2]
|
2024-05-24 08:53:19 +00:00
|
|
|
runs-on: [self-hosted, style-checker-aarch64]
|
2021-11-22 11:54:02 +00:00
|
|
|
steps:
|
|
|
|
- name: Check out repository code
|
2022-12-23 16:54:19 +00:00
|
|
|
uses: ClickHouse/checkout@v1
|
2021-11-22 11:54:02 +00:00
|
|
|
- name: Finish label
|
|
|
|
run: |
|
2022-01-13 18:06:35 +00:00
|
|
|
cd "$GITHUB_WORKSPACE/tests/ci"
|
2024-06-13 14:14:57 +00:00
|
|
|
python3 finish_check.py --wf-status ${{ contains(needs.*.result, 'failure') && 'failure' || 'success' }}
|
2024-07-22 13:46:27 +00:00
|
|
|
- name: Check Workflow results
|
2024-07-25 10:12:37 +00:00
|
|
|
if: ${{ !cancelled() }}
|
2024-07-22 13:46:27 +00:00
|
|
|
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
|