Add reusable installation workflow

This commit is contained in:
Mikhail f. Shiryaev 2023-11-09 10:54:12 +01:00
parent 7a489059ac
commit dc6a61ee8f
No known key found for this signature in database
GPG Key ID: 4B02ED204C7D93F4

View File

@ -0,0 +1,64 @@
### For the pure soul wishes to move it to another place
# https://github.com/orgs/community/discussions/9050
name: Test installation
'on':
workflow_call:
inputs:
test_name:
description: the value of test 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: style-checker
type: string
additional_envs:
description: additional ENV variables to setup the job
type: string
jobs:
InstallCheck:
name: ${{inputs.test_name}}
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'
REPORTS_PATH=${{runner.temp}}/reports_dir
GITHUB_JOB_OVERRIDDEN=${{inputs.test_name}}
CHECK_NAME=${{inputs.test_name}}
${{inputs.additional_envs}}
EOF
- name: Common setup
uses: ./.github/actions/common_setup
with:
job_type: test_install
- name: Download json reports
uses: actions/download-artifact@v3
with:
path: ${{ env.REPORTS_PATH }}
- name: Build
run: |
cd "$REPO_COPY/tests/ci"
python3 install_check.py "$CHECK_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
uses: ./.github/actions/clean