From 15d27d5e859d66fce8d77cfa3ba1d4d4636511aa Mon Sep 17 00:00:00 2001 From: "Mikhail f. Shiryaev" Date: Sat, 11 Nov 2023 00:29:57 +0100 Subject: [PATCH] Rewrite docs test to reusable workflow --- .github/workflows/docs_check.yml | 37 ++++++++------------------------ tests/ci/docs_check.py | 6 ++++-- 2 files changed, 13 insertions(+), 30 deletions(-) diff --git a/.github/workflows/docs_check.yml b/.github/workflows/docs_check.yml index c311679c8a3..d7699f0419d 100644 --- a/.github/workflows/docs_check.yml +++ b/.github/workflows/docs_check.yml @@ -113,34 +113,15 @@ jobs: RCSK DocsCheck: needs: DockerHubPush - runs-on: [self-hosted, func-tester-aarch64] - steps: - - name: Set envs - run: | - cat >> "$GITHUB_ENV" << 'EOF' - TEMP_PATH=${{runner.temp}}/docs_check - REPO_COPY=${{runner.temp}}/docs_check/ClickHouse - EOF - - name: Download changed images - uses: actions/download-artifact@v3 - with: - name: changed_images - path: ${{ env.TEMP_PATH }} - - name: Check out repository code - uses: ClickHouse/checkout@v1 - with: - clear-repository: true - - name: Docs Check - run: | - cp -r "$GITHUB_WORKSPACE" "$TEMP_PATH" - cd "$REPO_COPY/tests/ci" - python3 docs_check.py - - name: Cleanup - if: always() - run: | - docker ps --quiet | xargs --no-run-if-empty docker kill ||: - docker ps --all --quiet | xargs --no-run-if-empty docker rm -f ||: - sudo rm -fr "$TEMP_PATH" + uses: ./.github/workflows/reusable_test.yml + with: + test_name: Docs check + runner_type: func-tester-aarch64 + additional_envs: | + batches: 1 + run_command: | + cd "$REPO_COPY/tests/ci" + python3 docs_check.py FinishCheck: needs: - StyleCheck diff --git a/tests/ci/docs_check.py b/tests/ci/docs_check.py index f7339d59a5e..650ed93aa71 100644 --- a/tests/ci/docs_check.py +++ b/tests/ci/docs_check.py @@ -17,7 +17,7 @@ from commit_status_helper import ( update_mergeable_check, ) from docker_pull_helper import get_image_with_version -from env_helper import TEMP_PATH, REPO_COPY +from env_helper import TEMP_PATH, REPO_COPY, REPORTS_PATH from get_robot_token import get_best_robot_token from pr_info import PRInfo from report import TestResults, TestResult @@ -57,6 +57,8 @@ def main(): temp_path = Path(TEMP_PATH) temp_path.mkdir(parents=True, exist_ok=True) + reports_path = Path(REPORTS_PATH) + reports_path.mkdir(parents=True, exist_ok=True) repo_path = Path(REPO_COPY) pr_info = PRInfo(need_changed_files=True) @@ -82,7 +84,7 @@ def main(): elif args.force: logging.info("Check the docs because of force flag") - docker_image = get_image_with_version(temp_path, "clickhouse/docs-builder") + docker_image = get_image_with_version(reports_path, "clickhouse/docs-builder") test_output = temp_path / "docs_check_log" test_output.mkdir(parents=True, exist_ok=True)