2023-11-06 17:59:13 +00:00
|
|
|
### For the pure soul wishes to move it to another place
|
|
|
|
# https://github.com/orgs/community/discussions/9050
|
|
|
|
|
2023-11-13 10:06:03 +00:00
|
|
|
env:
|
|
|
|
# Force the stdout and stderr streams to be unbuffered
|
|
|
|
PYTHONUNBUFFERED: 1
|
|
|
|
|
2023-11-06 17:59:13 +00:00
|
|
|
name: Build ClickHouse
|
|
|
|
'on':
|
|
|
|
workflow_call:
|
|
|
|
inputs:
|
|
|
|
build_name:
|
|
|
|
description: the value of build type from tests/ci/ci_config.py
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
checkout_depth:
|
|
|
|
description: the value of the git shallow checkout
|
|
|
|
required: false
|
|
|
|
type: number
|
|
|
|
default: 1
|
|
|
|
runner_type:
|
|
|
|
description: the label of runner to use
|
|
|
|
default: builder
|
|
|
|
type: string
|
|
|
|
additional_envs:
|
|
|
|
description: additional ENV variables to setup the job
|
|
|
|
type: string
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
Build:
|
|
|
|
name: Build-${{inputs.build_name}}
|
2023-11-10 16:47:40 +00:00
|
|
|
env:
|
|
|
|
GITHUB_JOB_OVERRIDDEN: Build-${{inputs.build_name}}
|
2023-11-06 17:59:13 +00:00
|
|
|
runs-on: [self-hosted, '${{inputs.runner_type}}']
|
|
|
|
steps:
|
|
|
|
- name: Check out repository code
|
|
|
|
uses: ClickHouse/checkout@v1
|
|
|
|
with:
|
|
|
|
clear-repository: true
|
|
|
|
submodules: true
|
|
|
|
fetch-depth: ${{inputs.checkout_depth}}
|
|
|
|
filter: tree:0
|
|
|
|
- name: Set build envs
|
|
|
|
run: |
|
|
|
|
cat >> "$GITHUB_ENV" << 'EOF'
|
|
|
|
${{inputs.additional_envs}}
|
|
|
|
EOF
|
2023-11-08 11:52:19 +00:00
|
|
|
python3 "$GITHUB_WORKSPACE"/tests/ci/ci_config.py --build-name "${{inputs.build_name}}" >> "$GITHUB_ENV"
|
|
|
|
- name: Apply sparse checkout for contrib # in order to check that it doesn't break build
|
|
|
|
# This step is done in GITHUB_WORKSPACE,
|
|
|
|
# because it's broken in REPO_COPY for some reason
|
|
|
|
if: ${{ env.BUILD_SPARSE_CHECKOUT == 'true' }}
|
|
|
|
run: |
|
|
|
|
rm -rf "$GITHUB_WORKSPACE/contrib" && echo 'removed'
|
|
|
|
git -C "$GITHUB_WORKSPACE" checkout . && echo 'restored'
|
|
|
|
"$GITHUB_WORKSPACE/contrib/update-submodules.sh" && echo 'OK'
|
|
|
|
du -hs "$GITHUB_WORKSPACE/contrib" ||:
|
|
|
|
find "$GITHUB_WORKSPACE/contrib" -type f | wc -l ||:
|
2023-11-06 17:59:13 +00:00
|
|
|
- name: Common setup
|
|
|
|
uses: ./.github/actions/common_setup
|
|
|
|
with:
|
|
|
|
job_type: build_check
|
|
|
|
- name: Download changed images
|
|
|
|
uses: actions/download-artifact@v3
|
|
|
|
with:
|
|
|
|
name: changed_images
|
|
|
|
path: ${{ env.IMAGES_PATH }}
|
|
|
|
- name: Build
|
|
|
|
run: |
|
|
|
|
cd "$REPO_COPY/tests/ci" && python3 build_check.py "$BUILD_NAME"
|
|
|
|
- name: Upload build URLs to artifacts
|
|
|
|
if: ${{ success() || failure() }}
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: ${{ env.BUILD_URLS }}
|
|
|
|
path: ${{ env.TEMP_PATH }}/${{ env.BUILD_URLS }}.json
|
|
|
|
- name: Clean
|
2023-11-13 06:41:17 +00:00
|
|
|
if: always()
|
2023-11-06 17:59:13 +00:00
|
|
|
uses: ./.github/actions/clean
|