forked from suharev7/clickhouse-rs
-
Notifications
You must be signed in to change notification settings - Fork 2
76 lines (73 loc) · 2.46 KB
/
Copy pathtest.yml
File metadata and controls
76 lines (73 loc) · 2.46 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
name: Test
on:
workflow_dispatch: {}
push:
branches:
- async-await
pull_request:
branches:
- async-await
- next
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
build:
runs-on: ubuntu-latest
services:
clickhouse:
image: clickhouse/clickhouse-server
ports:
- 9000:9000
env:
CLICKHOUSE_SKIP_USER_SETUP: 1
steps:
- uses: actions/checkout@v3
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
build-tls:
strategy:
fail-fast: false
matrix:
feature:
- tls-native-tls
- tls-rustls
database_url:
# for TLS we need skip_verify for self-signed certificate
- tcp://localhost:9440?skip_verify=true
# we don't need skip_verify when we pass CA cert
- tcp://localhost:9440?ca_certificate=tls/ca.pem
# mTLS
- tcp://tls@localhost:9440?ca_certificate=tls/ca.pem&client_certificate=tls/client.crt&client_private_key=tls/client.key
runs-on: ubuntu-latest
env:
# NOTE: not all tests "secure" aware, so let's define DATABASE_URL explicitly
# NOTE: sometimes for native-tls default connection_timeout (500ms) is not enough, interestingly that for rustls it is OK.
DATABASE_URL: ${{ matrix.database_url }}&compression=lz4&ping_timeout=2s&retry_timeout=3s&secure=true&connection_timeout=5s
steps:
- uses: actions/checkout@v3
- name: Generate TLS certificates
run: |
extras/ci/generate_certs.sh tls
# NOTE:
# - we cannot use "services" because they are executed before the steps, i.e. repository checkout.
# - "job.container.network" is empty, hence "host"
# - github actions does not support YAML anchors (sigh)
- name: Run clickhouse-server
run: docker run
-v ./extras/ci/overrides.xml:/etc/clickhouse-server/config.d/overrides.xml
-v ./extras/ci/users-overrides.yaml:/etc/clickhouse-server/users.d/overrides.yaml
-v ./tls:/etc/clickhouse-server/tls
-e CLICKHOUSE_SKIP_USER_SETUP=1
--network host
--name clickhouse
--rm
--detach
--publish 9440:9440
clickhouse/clickhouse-server
- name: Build
run: cargo build --features ${{ matrix.feature }} --verbose
- name: Run tests
run: cargo test --features ${{ matrix.feature }} --verbose