-
Notifications
You must be signed in to change notification settings - Fork 65
141 lines (125 loc) · 4.07 KB
/
Copy pathexamples.yml
File metadata and controls
141 lines (125 loc) · 4.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: "examples"
permissions: {}
on:
workflow_dispatch:
push:
branches:
- main
- release
paths:
- "packages/**"
- "examples/**"
- "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/examples.yml"
pull_request:
paths:
- "packages/**"
- "examples/**"
- "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/examples.yml"
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
strategy:
fail-fast: false
matrix:
package: [node, web]
defaults:
run:
working-directory: examples/${{ matrix.package }}
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: Typecheck
run: |
npm run typecheck
- name: Run linting
run: |
npm run lint
run-examples:
timeout-minutes: 10
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
clickhouse: [head, latest]
package: [node, web]
defaults:
run:
working-directory: examples/${{ matrix.package }}
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 examples dependencies
run: |
npm install
- name: Install Playwright Chromium
if: matrix.package == 'web'
run: |
npx playwright install chromium
- name: Add ClickHouse TLS instance to /etc/hosts
run: |
echo "127.0.0.1 server.clickhouseconnect.test" | sudo tee -a /etc/hosts
- name: Warm up system.query_log
run: |
docker exec clickhouse-js-clickhouse-server clickhouse-client --query "SELECT 1"
sleep 8
- name: Run examples
env:
CLICKHOUSE_CLOUD_URL: https://${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_HOST_SMT_PROD }}/
CLICKHOUSE_CLOUD_PASSWORD: ${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_PASSWORD_SMT_PROD }}
run: |
npm run run-examples