Cloud Integration #347
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Cloud Integration | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "0 3 * * 1-5" | |
| pull_request: | |
| paths: | |
| - "crates/clickhouse-cloud-api/src/**" | |
| - "crates/clickhouse-cloud-api/tests/**" | |
| - "crates/clickhouse-cloud-api/Cargo.toml" | |
| - "crates/clickhousectl/src/cloud/cli.rs" | |
| - "crates/clickhousectl/src/cloud/commands.rs" | |
| - "crates/clickhousectl/src/cloud/client.rs" | |
| - "Cargo.lock" | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: cloud-integration-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| cloud-integration: | |
| name: Cloud integration tests | |
| runs-on: ubuntu-latest | |
| environment: cloud-integration | |
| env: | |
| CLICKHOUSE_CLOUD_API_KEY: ${{ secrets.CLICKHOUSE_CLOUD_API_KEY }} | |
| CLICKHOUSE_CLOUD_API_SECRET: ${{ secrets.CLICKHOUSE_CLOUD_API_SECRET }} | |
| # Defaults to https://api.clickhouse.cloud (production) when unset. Set | |
| # the repo variable to https://api.control-plane.clickhouse-staging.com | |
| # to run integration tests against staging. | |
| CLICKHOUSE_CLOUD_API_BASE_URL: ${{ vars.CLICKHOUSE_CLOUD_API_BASE_URL }} | |
| CLICKHOUSE_CLOUD_TEST_ORG_ID: ${{ secrets.CLICKHOUSE_CLOUD_TEST_ORG_ID }} | |
| CLICKHOUSE_CLOUD_TEST_PROVIDER: ${{ secrets.CLICKHOUSE_CLOUD_TEST_PROVIDER }} | |
| CLICKHOUSE_CLOUD_TEST_REGION: ${{ secrets.CLICKHOUSE_CLOUD_TEST_REGION }} | |
| CLICKHOUSE_CLOUD_TEST_SECONDARY_USER_ID: ${{ secrets.CLICKHOUSE_CLOUD_TEST_SECONDARY_USER_ID }} | |
| CLICKHOUSE_CLOUD_TEST_TIMEOUT_CREATE_SECS: ${{ vars.CLICKHOUSE_CLOUD_TEST_TIMEOUT_CREATE_SECS || '1800' }} | |
| CLICKHOUSE_CLOUD_TEST_TIMEOUT_DELETE_SECS: ${{ vars.CLICKHOUSE_CLOUD_TEST_TIMEOUT_DELETE_SECS || '900' }} | |
| CLICKHOUSE_CLOUD_TEST_TIMEOUT_STEADY_STATE_SECS: ${{ vars.CLICKHOUSE_CLOUD_TEST_TIMEOUT_STEADY_STATE_SECS || '1800' }} | |
| CLICKHOUSE_CLOUD_TEST_CLICKPIPE_SERVICE_ID: ${{ vars.CLICKHOUSE_CLOUD_TEST_CLICKPIPE_SERVICE_ID }} | |
| RUST_TEST_THREADS: 1 | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Resolve test run label | |
| run: | | |
| case "${{ github.event_name }}" in | |
| pull_request) | |
| echo "CLICKHOUSE_CLOUD_TEST_RUN_LABEL=pr-${{ github.event.pull_request.number }}" >> "$GITHUB_ENV" | |
| ;; | |
| schedule) | |
| echo "CLICKHOUSE_CLOUD_TEST_RUN_LABEL=nightly" >> "$GITHUB_ENV" | |
| ;; | |
| workflow_dispatch) | |
| echo "CLICKHOUSE_CLOUD_TEST_RUN_LABEL=manual-${{ github.run_id }}" >> "$GITHUB_ENV" | |
| ;; | |
| esac | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable @ 2026-03-27 | |
| - name: Run cloud integration suite | |
| run: cargo test -p clickhouse-cloud-api --test integration_test -- --ignored --nocapture | |
| - name: Run cloud Postgres integration suite | |
| run: cargo test -p clickhouse-cloud-api --test integration_postgres_test -- --ignored --nocapture | |
| - name: Run cloud Org integration suite | |
| run: cargo test -p clickhouse-cloud-api --test integration_org_test -- --ignored --nocapture | |
| - name: Run ClickPipe Postgres CDC integration test | |
| run: cargo test -p clickhouse-cloud-api --test clickpipe_postgres_cdc_test -- --ignored --nocapture | |
| # ClickPipe create smoke tests run against a long-lived ClickHouse Cloud | |
| # service to avoid the multi-minute service-create cost. Provision a | |
| # service once and set the CLICKHOUSE_CLOUD_TEST_CLICKPIPE_SERVICE_ID | |
| # repository variable to its ID. The step is skipped if that variable | |
| # is unset so first-time setup doesn't block PRs. | |
| - name: Run ClickPipe create smoke suite | |
| if: ${{ vars.CLICKHOUSE_CLOUD_TEST_CLICKPIPE_SERVICE_ID != '' }} | |
| run: cargo test -p clickhouse-cloud-api --test clickpipe_smoke_test -- --ignored --nocapture |