# yamllint disable rule:comments-indentation name: PullRequestCI env: # Force the stdout and stderr streams to be unbuffered PYTHONUNBUFFERED: 1 on: # yamllint disable-line rule:truthy pull_request: types: - synchronize - reopened - opened branches: - master paths-ignore: - '**.md' - 'docker/docs/**' - 'docs/**' - 'utils/check-style/aspell-ignore/**' - 'tests/ci/docs_check.py' - '.github/workflows/docs_check.yml' ########################################################################################## ##################################### SMALL CHECKS ####################################### ########################################################################################## jobs: CheckLabels: runs-on: [self-hosted, style-checker] # Run the first check always, even if the CI is cancelled if: ${{ always() }} steps: - name: Check out repository code uses: ClickHouse/checkout@v1 with: clear-repository: true - name: Labels check run: | cd "$GITHUB_WORKSPACE/tests/ci" python3 run_check.py PythonUnitTests: runs-on: [self-hosted, style-checker] steps: - name: Check out repository code uses: ClickHouse/checkout@v1 with: clear-repository: true - name: Python unit tests run: | cd "$GITHUB_WORKSPACE/tests/ci" echo "Testing the main ci directory" python3 -m unittest discover -s . -p 'test_*.py' for dir in *_lambda/; do echo "Testing $dir" python3 -m unittest discover -s "$dir" -p 'test_*.py' done DockerHubPushAarch64: needs: CheckLabels runs-on: [self-hosted, style-checker-aarch64] steps: - name: Check out repository code uses: ClickHouse/checkout@v1 with: clear-repository: true - name: Images check run: | cd "$GITHUB_WORKSPACE/tests/ci" python3 docker_images_check.py --suffix aarch64 - name: Upload images files to artifacts uses: actions/upload-artifact@v3 with: name: changed_images_aarch64 path: ${{ runner.temp }}/docker_images_check/changed_images_aarch64.json DockerHubPushAmd64: needs: CheckLabels runs-on: [self-hosted, style-checker] steps: - name: Check out repository code uses: ClickHouse/checkout@v1 with: clear-repository: true - name: Images check run: | cd "$GITHUB_WORKSPACE/tests/ci" python3 docker_images_check.py --suffix amd64 - name: Upload images files to artifacts uses: actions/upload-artifact@v3 with: name: changed_images_amd64 path: ${{ runner.temp }}/docker_images_check/changed_images_amd64.json DockerHubPush: needs: [DockerHubPushAmd64, DockerHubPushAarch64, PythonUnitTests] runs-on: [self-hosted, style-checker] steps: - name: Check out repository code uses: ClickHouse/checkout@v1 with: clear-repository: true fetch-depth: 0 # to find ancestor merge commits necessary for finding proper docker tags filter: tree:0 - name: Download changed aarch64 images uses: actions/download-artifact@v3 with: name: changed_images_aarch64 path: ${{ runner.temp }} - name: Download changed amd64 images uses: actions/download-artifact@v3 with: name: changed_images_amd64 path: ${{ runner.temp }} - name: Images check run: | cd "$GITHUB_WORKSPACE/tests/ci" python3 docker_manifests_merge.py --suffix amd64 --suffix aarch64 - name: Upload images files to artifacts uses: actions/upload-artifact@v3 with: name: changed_images path: ${{ runner.temp }}/changed_images.json StyleCheck: needs: DockerHubPush # We need additional `&& ! cancelled()` to have the job being able to cancel if: ${{ success() || failure() || ( always() && ! cancelled() ) }} uses: ./.github/workflows/reusable_test.yml with: test_name: Style check runner_type: style-checker run_command: | cd "$REPO_COPY/tests/ci" python3 style_check.py secrets: secret_envs: | ROBOT_CLICKHOUSE_SSH_KEY<