From 809fd5ecbb20420322073f2360199dee8b64f6c7 Mon Sep 17 00:00:00 2001 From: Marcus Kainth Date: Fri, 25 Sep 2026 11:42:42 +0100 Subject: [PATCH] ci: start ClickHouse while the test archives download A test job ran `make up` first and waited for the server to report healthy, 15 to 27 s, before installing nextest and downloading the archives. None of those need the server. The job now starts `docker compose up -d --wait` in the background as its first step after checkout, writing its log and exit status under RUNNER_TEMP. Before the suites, "Wait for ClickHouse" waits for that status, prints the log, and runs `make up`, which returns at once when the server answers and starts it itself when it doesn't. --- .github/workflows/ci.yml | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a4fdad9..c3041d3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -211,11 +211,15 @@ jobs: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false + - name: Start the pinned ClickHouse in the background + # The server starts while nextest installs and the archives download. + # "Wait for ClickHouse" joins it before the suites run. + run: | + { docker compose up -d --wait; echo $? > "$RUNNER_TEMP/clickhouse-up.status"; } \ + > "$RUNNER_TEMP/clickhouse-up.log" 2>&1 & - uses: taiki-e/install-action@3f74d7c16a4242f1c95561e98edc25d36adb4375 # v2.87.12 with: tool: cargo-nextest@0.9.140 - - name: Start the pinned ClickHouse - run: make up # Each group downloads the archives scripts/test-group.sh runs it # from, and a group that lacks one fails on the missing file. - name: Download the native crate's suites @@ -245,6 +249,14 @@ jobs: with: name: refemu path: target/release + - name: Wait for ClickHouse + run: | + for _ in $(seq 300); do + [ -f "$RUNNER_TEMP/clickhouse-up.status" ] && break + sleep 1 + done + cat "$RUNNER_TEMP/clickhouse-up.log" + make up - name: The group's suites env: CLICKHOUSE_HOST: localhost @@ -276,16 +288,28 @@ jobs: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false + - name: Start the pinned ClickHouse in the background + # The server starts while nextest installs and the archives download. + # "Wait for ClickHouse" joins it before the suites run. + run: | + { docker compose up -d --wait; echo $? > "$RUNNER_TEMP/clickhouse-up.status"; } \ + > "$RUNNER_TEMP/clickhouse-up.log" 2>&1 & - uses: taiki-e/install-action@3f74d7c16a4242f1c95561e98edc25d36adb4375 # v2.87.12 with: tool: cargo-nextest@0.9.140 - - name: Start the pinned ClickHouse - run: make up - name: Download the native crate's suites uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: native-tests path: target/nextest + - name: Wait for ClickHouse + run: | + for _ in $(seq 300); do + [ -f "$RUNNER_TEMP/clickhouse-up.status" ] && break + sleep 1 + done + cat "$RUNNER_TEMP/clickhouse-up.log" + make up - name: The group's suites env: CLICKHOUSE_HOST: localhost