-
Notifications
You must be signed in to change notification settings - Fork 120
83 lines (79 loc) · 3.01 KB
/
test.yml
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
name: Test
on:
workflow_dispatch: {}
push:
branches:
- async-await
pull_request:
branches:
- async-await
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
build:
runs-on: ubuntu-latest
services:
clickhouse:
image: clickhouse/clickhouse-server
ports:
- 9000:9000
steps:
- uses: actions/checkout@v3
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
build-native-tls:
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: "tcp://localhost:9440?compression=lz4&ping_timeout=2s&retry_timeout=3s&secure=true&skip_verify=true&connection_timeout=5s"
steps:
- uses: actions/checkout@v3
# 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/generate_certs.sh:/docker-entrypoint-initdb.d/generate_certs.sh
-v ./extras/ci/overrides.xml:/etc/clickhouse-server/config.d/overrides.xml
-e CH_SSL_CERTIFICATE=/etc/clickhouse-server/config.d/server.crt
-e CH_SSL_PRIVATE_KEY=/etc/clickhouse-server/config.d/server.key
--network host
--rm
--detach
--publish 9440:9440
clickhouse/clickhouse-server
- name: Build
run: cargo build --features tls-native-tls --verbose
- name: Run tests
run: cargo test --features tls-native-tls --verbose
build-rustls:
runs-on: ubuntu-latest
env:
# NOTE: not all tests "secure" aware, so let's define DATABASE_URL explicitly
DATABASE_URL: "tcp://localhost:9440?compression=lz4&ping_timeout=2s&retry_timeout=3s&secure=true&skip_verify=true"
steps:
- uses: actions/checkout@v3
# 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/generate_certs.sh:/docker-entrypoint-initdb.d/generate_certs.sh
-v ./extras/ci/overrides.xml:/etc/clickhouse-server/config.d/overrides.xml
-e CH_SSL_CERTIFICATE=/etc/clickhouse-server/config.d/server.crt
-e CH_SSL_PRIVATE_KEY=/etc/clickhouse-server/config.d/server.key
--network host
--rm
--detach
--publish 9440:9440
clickhouse/clickhouse-server
- name: Build
run: cargo build --features tls-rustls --verbose
- name: Run tests
run: cargo test --features tls-rustls --verbose