Skip to content

fix: bind scalar Date/Date32 query parameters as date strings #475

fix: bind scalar Date/Date32 query parameters as date strings

fix: bind scalar Date/Date32 query parameters as date strings #475

Workflow file for this run

name: "node"
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-node.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-node.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:
code-quality:
timeout-minutes: 5
runs-on: ubuntu-latest
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
- name: Build packages
run: |
npm run build
- name: Typecheck
run: |
npm run typecheck
- name: Run linting
run: |
npm run lint
- name: Check formatting (Prettier)
env:
NO_COLOR: "1"
run: |
if ! npm run -s prettier:check > prettier-output.txt 2>&1; then
cat prettier-output.txt
grep -E '^\[warn\] ' prettier-output.txt \
| grep -vE 'Code style issues|Run Prettier|Forgot to run' \
| sed -E 's#^\[warn\] (.+)$#::error file=\1::File is not formatted with Prettier. Run "npm run prettify" to fix.#' || true
echo "::error::Prettier check failed. Run 'npm run prettify' locally to fix formatting."
exit 1
fi
cat prettier-output.txt
unit-tests:
timeout-minutes: 5
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: [20, 22, 24, 26]
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Setup NodeJS ${{ matrix.node }}
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: ${{ matrix.node }}
- name: Install dependencies
run: |
npm install
- name: Install dependencies (Node examples)
working-directory: examples/node
run: |
npm install
- name: Run unit tests
run: |
npm run test:node:unit
- name: Export coverage metrics
env:
COVERAGE_REPORT_NAME: ${{ github.job }} (${{ matrix.node }})
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 (Node 24) 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.node == 24 }}
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v6.0.2
with:
name: node-unit
flags: node-unit
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/lcov.info
fail_ci_if_error: true
integration-tests-local-single-node:
timeout-minutes: 5
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: [20, 22, 24, 26]
clickhouse: [head, latest]
log_level: [undefined, TRACE]
include:
- node: 24
clickhouse: 26.2
log_level: undefined
- node: 24
clickhouse: 26.1
log_level: undefined
- node: 24
clickhouse: 25.12
log_level: undefined
- node: 24
clickhouse: 25.11
log_level: undefined
- node: 24
clickhouse: 25.10
log_level: undefined
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 ${{ matrix.node }}
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: ${{ matrix.node }}
- name: Install dependencies
run: |
npm install
- name: Add ClickHouse TLS instance to /etc/hosts
run: |
sudo echo "127.0.0.1 server.clickhouseconnect.test" | sudo tee -a /etc/hosts
- name: Run integration tests with TLS tests
env:
LOG_LEVEL: ${{ matrix.log_level }}
run: |
npm run test:node:integration:tls
- name: Export coverage metrics
env:
COVERAGE_REPORT_NAME: ${{ github.job }} (${{ matrix.node }}, ${{ matrix.clickhouse }}, ${{ matrix.log_level }})
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 (Node 24, ClickHouse
# latest, default log level) 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.node == 24 && matrix.clickhouse == 'latest' && matrix.log_level == 'undefined' }}
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v6.0.2
with:
name: node-integration-single
flags: node-integration-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:
node: [20, 22, 24, 26]
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 ${{ matrix.node }}
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: ${{ matrix.node }}
- name: Install dependencies
run: |
npm install
- name: Run integration tests
run: |
npm run test:node:integration:local_cluster
- name: Export coverage metrics
env:
COVERAGE_REPORT_NAME: ${{ github.job }} (${{ matrix.node }})
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 (Node 24, 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.node == 24 && matrix.clickhouse == 'latest' }}
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v6.0.2
with:
name: node-integration-cluster
flags: node-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:
node: [20, 22, 24, 26]
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Setup NodeJS ${{ matrix.node }}
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: ${{ matrix.node }}
- name: Install dependencies
run: |
npm install
- name: Run integration tests
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 }}
run: |
npm run test:node:integration:cloud
- name: Export coverage metrics
env:
COVERAGE_REPORT_NAME: ${{ github.job }} (${{ matrix.node }})
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 (Node 24) 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.node == 24 }}
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v6.0.2
with:
name: node-integration-cloud
flags: node-integration-cloud
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/lcov.info
fail_ci_if_error: true