2023-12-18 08:07:22 +00:00
|
|
|
### For the pure soul wishes to move it to another place
|
|
|
|
# https://github.com/orgs/community/discussions/9050
|
|
|
|
|
|
|
|
name: Simple job
|
|
|
|
'on':
|
|
|
|
workflow_call:
|
|
|
|
inputs:
|
|
|
|
test_name:
|
|
|
|
description: the value of test type from tests/ci/ci_config.py, ends up as $CHECK_NAME ENV
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
runner_type:
|
|
|
|
description: the label of runner to use
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
run_command:
|
|
|
|
description: the command to launch the check
|
|
|
|
default: ""
|
|
|
|
required: false
|
|
|
|
type: string
|
|
|
|
checkout_depth:
|
|
|
|
description: the value of the git shallow checkout
|
|
|
|
required: false
|
|
|
|
type: number
|
|
|
|
default: 1
|
|
|
|
submodules:
|
|
|
|
description: if the submodules should be checked out
|
|
|
|
required: false
|
|
|
|
type: boolean
|
|
|
|
default: false
|
|
|
|
additional_envs:
|
|
|
|
description: additional ENV variables to setup the job
|
|
|
|
type: string
|
|
|
|
working-directory:
|
|
|
|
description: sets custom working directory
|
|
|
|
type: string
|
2024-01-04 15:35:09 +00:00
|
|
|
default: "$GITHUB_WORKSPACE/tests/ci"
|
2023-12-18 08:07:22 +00:00
|
|
|
git_ref:
|
|
|
|
description: commit to use, merge commit for pr or head
|
|
|
|
required: false
|
|
|
|
type: string
|
|
|
|
default: ${{ github.event.after }} # no merge commit
|
2024-01-04 15:35:09 +00:00
|
|
|
report_required:
|
|
|
|
description: set to true if job report with the commit status required
|
|
|
|
type: boolean
|
|
|
|
default: false
|
2023-12-18 08:07:22 +00:00
|
|
|
secrets:
|
2024-11-18 13:02:57 +00:00
|
|
|
robot_git_token:
|
|
|
|
required: false
|
|
|
|
ci_db_url:
|
|
|
|
required: false
|
|
|
|
ci_db_password:
|
2023-12-18 08:07:22 +00:00
|
|
|
required: false
|
|
|
|
|
|
|
|
|
|
|
|
env:
|
|
|
|
# Force the stdout and stderr streams to be unbuffered
|
|
|
|
PYTHONUNBUFFERED: 1
|
|
|
|
CHECK_NAME: ${{inputs.test_name}}
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
Test:
|
|
|
|
runs-on: [self-hosted, '${{inputs.runner_type}}']
|
|
|
|
name: ${{inputs.test_name}}
|
|
|
|
env:
|
|
|
|
GITHUB_JOB_OVERRIDDEN: ${{inputs.test_name}}
|
|
|
|
steps:
|
|
|
|
- name: Check out repository code
|
|
|
|
uses: ClickHouse/checkout@v1
|
|
|
|
with:
|
|
|
|
clear-repository: true
|
|
|
|
ref: ${{ inputs.git_ref }}
|
|
|
|
submodules: ${{inputs.submodules}}
|
|
|
|
fetch-depth: ${{inputs.checkout_depth}}
|
|
|
|
filter: tree:0
|
2024-09-13 15:20:49 +00:00
|
|
|
- name: Debug Info
|
|
|
|
uses: ./.github/actions/debug
|
2023-12-18 08:07:22 +00:00
|
|
|
- name: Set build envs
|
|
|
|
run: |
|
|
|
|
cat >> "$GITHUB_ENV" << 'EOF'
|
|
|
|
CHECK_NAME=${{ inputs.test_name }}
|
|
|
|
${{inputs.additional_envs}}
|
2024-11-18 13:02:57 +00:00
|
|
|
ROBOT_CLICKHOUSE_SSH_KEY<<RCSK
|
|
|
|
${{secrets.robot_git_token}}
|
|
|
|
RCSK
|
|
|
|
CI_DB_URL<<CIDBU
|
|
|
|
${{ secrets.ci_db_url }}
|
|
|
|
CIDBU
|
|
|
|
CI_DB_PASSWORD<<CIDBP
|
|
|
|
${{ secrets.ci_db_password }}
|
|
|
|
CIDBP
|
2023-12-18 08:07:22 +00:00
|
|
|
EOF
|
|
|
|
- name: Common setup
|
|
|
|
uses: ./.github/actions/common_setup
|
|
|
|
with:
|
|
|
|
job_type: test
|
|
|
|
- name: Run
|
|
|
|
run: |
|
2024-01-04 15:35:09 +00:00
|
|
|
cd "${{ inputs.working-directory }}"
|
2023-12-18 08:07:22 +00:00
|
|
|
${{ inputs.run_command }}
|
2024-01-04 15:35:09 +00:00
|
|
|
- name: Post
|
|
|
|
if: ${{ inputs.report_required }}
|
|
|
|
run: |
|
|
|
|
python3 "$GITHUB_WORKSPACE/tests/ci/ci.py" --post --job-name '${{inputs.test_name}}'
|
2023-12-18 08:07:22 +00:00
|
|
|
- name: Clean
|
|
|
|
if: always()
|
|
|
|
uses: ./.github/actions/clean
|