Skip to content

Merge pull request #954 from ClickHouse/main #450

Merge pull request #954 from ClickHouse/main

Merge pull request #954 from ClickHouse/main #450

Workflow file for this run

name: "web"
permissions: {}
on:
workflow_dispatch:
push:
branches:
- main
- release
paths:
- "packages/**"
- "tests/**"
- "package.json"
- "package-lock.json"
- "tsconfig.base.json"
- "tsconfig.dev.json"
- "eslint.config.base.mjs"
- "docker-compose.yml"
- "packages/client-node/vitest.config.ts"
- "packages/client-node/vitest.setup.ts"
- "packages/client-web/vitest.config.ts"
- "packages/client-web/vitest.setup.ts"
- ".github/workflows/tests-web.yml"
pull_request:
paths:
- "packages/**"
- "tests/**"
- "package.json"
- "package-lock.json"
- "tsconfig.base.json"
- "tsconfig.dev.json"
- "eslint.config.base.mjs"
- "docker-compose.yml"
- "packages/client-node/vitest.config.ts"
- "packages/client-node/vitest.setup.ts"
- "packages/client-web/vitest.config.ts"
- "packages/client-web/vitest.setup.ts"
- ".github/workflows/tests-web.yml"
schedule:
- cron: "0 9 * * *"
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
env:
OTEL_SERVICE_NAME: vitest
OTEL_EXPORTER_OTLP_ENDPOINT: ${{ secrets.OTEL_EXPORTER_OTLP_ENDPOINT }}
OTEL_EXPORTER_OTLP_HEADERS: "authorization=${{ secrets.OTEL_EXPORTER_OTLP_API_KEY }}"
OTEL_RESOURCE_ATTRIBUTES: "service.namespace=clickhouse-js,deployment.environment=ci"
VITEST_OTEL_ENABLED: "true"
VITEST_COVERAGE: "true"
# Network resilience: npm's default of 2 fetch retries is not enough for
# the transient registry errors (ECONNRESET) we regularly hit in CI.
NPM_CONFIG_FETCH_RETRIES: "5"
NPM_CONFIG_FETCH_RETRY_MINTIMEOUT: "10000"
NPM_CONFIG_FETCH_RETRY_MAXTIMEOUT: "60000"
NPM_CONFIG_FETCH_TIMEOUT: "600000"
jobs:
all-tests-local-single-node:
timeout-minutes: 5
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
browser: [chromium, firefox] # We're not testing in WebKit atm
clickhouse: [head, latest]
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Start ClickHouse (version - ${{ matrix.clickhouse }}) in Docker
uses: hoverkraft-tech/compose-action@11beaa1c2dae4e8ed7b1665aa074723b6cecb0e4 # v3.0.0
env:
CLICKHOUSE_VERSION: ${{ matrix.clickhouse }}
with:
compose-file: "docker-compose.yml"
down-flags: "--volumes"
- name: Setup NodeJS
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: 24
- name: Install dependencies
run: |
npm install
npx playwright install ${{ matrix.browser }}
- name: Run all web tests
env:
BROWSER: ${{ matrix.browser }}
run: |
npm run test:web:all
- name: Export coverage metrics
env:
COVERAGE_REPORT_NAME: ${{ github.job }} (${{ matrix.browser }}, ${{ matrix.clickhouse }})
run: |
node .scripts/export-coverage-metrics.mjs
- name: Upload coverage to Codecov
# Codecov token is not available for Dependabot PRs or PRs from forks; skip the upload in those cases.
# Upload coverage from a single canonical combination (Chromium, ClickHouse
# latest) so Codecov receives exactly one upload per flag.
if: ${{ github.triggering_actor != 'dependabot[bot]' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && matrix.browser == 'chromium' && matrix.clickhouse == 'latest' }}
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v6.0.2
with:
name: web-all-single
flags: web-all-single
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/lcov.info
fail_ci_if_error: true
integration-tests-local-cluster:
timeout-minutes: 5
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
browser: [chromium, firefox] # We're not testing in WebKit atm
clickhouse: [head, latest]
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Start ClickHouse cluster (version - ${{ matrix.clickhouse }}) in Docker
uses: hoverkraft-tech/compose-action@11beaa1c2dae4e8ed7b1665aa074723b6cecb0e4 # v3.0.0
env:
CLICKHOUSE_VERSION: ${{ matrix.clickhouse }}
with:
compose-file: "docker-compose.yml"
down-flags: "--volumes"
- name: Setup NodeJS
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: 24
- name: Install dependencies
run: |
npm install
npx playwright install ${{ matrix.browser }}
- name: Run all web tests
env:
BROWSER: ${{ matrix.browser }}
run: |
npm run test:web:integration:local_cluster
- name: Export coverage metrics
env:
COVERAGE_REPORT_NAME: ${{ github.job }} (${{ matrix.browser }}, ${{ matrix.clickhouse }})
run: |
node .scripts/export-coverage-metrics.mjs
- name: Upload coverage to Codecov
# Codecov token is not available for Dependabot PRs or PRs from forks; skip the upload in those cases.
# Upload coverage from a single canonical combination (Chromium, ClickHouse
# latest) so Codecov receives exactly one upload per flag.
if: ${{ github.triggering_actor != 'dependabot[bot]' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && matrix.browser == 'chromium' && matrix.clickhouse == 'latest' }}
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v6.0.2
with:
name: web-integration-cluster
flags: web-integration-cluster
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/lcov.info
fail_ci_if_error: true
integration-tests-cloud:
# Cloud secrets are not available for PRs from forks or Dependabot PRs; skip the job in those cases.
if: ${{ github.triggering_actor != 'dependabot[bot]' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }}
timeout-minutes: 5
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
browser: [chromium, firefox] # We're not testing in WebKit atm
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Setup NodeJS
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: 24
- name: Install dependencies
run: |
npm install
npx playwright install ${{ matrix.browser }}
- name: Run integration tests and JWT auth
env:
CLICKHOUSE_CLOUD_HOST: ${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_HOST_SMT_PROD }}
CLICKHOUSE_CLOUD_PASSWORD: ${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_PASSWORD_SMT_PROD }}
CLICKHOUSE_CLOUD_JWT_ACCESS_TOKEN: ${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_JWT_DESERT_VM_43_PROD }}
BROWSER: ${{ matrix.browser }}
run: |
npm run test:web:integration:cloud:jwt
- name: Export coverage metrics
env:
COVERAGE_REPORT_NAME: ${{ github.job }} (${{ matrix.browser }})
run: |
node .scripts/export-coverage-metrics.mjs
- name: Upload coverage to Codecov
# Codecov token is not available for Dependabot PRs or PRs from forks; skip the upload in those cases.
# Upload coverage from a single canonical combination (Chromium) so Codecov
# receives exactly one upload per flag (see codecov.yml).
if: ${{ github.triggering_actor != 'dependabot[bot]' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && matrix.browser == 'chromium' }}
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v6.0.2
with:
name: web-integration-cloud
flags: web-integration-cloud
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/lcov.info
fail_ci_if_error: true