-
Notifications
You must be signed in to change notification settings - Fork 88
197 lines (164 loc) · 7.39 KB
/
Windows.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
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
name: Build and Test - Windows
on:
schedule:
- cron: '0 0 * * 1'
push:
branches: [ master ]
pull_request:
branches: [ master ]
release:
types:
- created
concurrency:
group: windows-${{ github.head_ref }}
cancel-in-progress: true
env:
CLICKHOUSE_SERVER_IMAGE: "yandex/clickhouse-server:20.3"
defaults:
run:
shell: powershell
working-directory: run
jobs:
build_and_test:
strategy:
fail-fast: false
matrix:
os: [windows-2019]
odbc_provider: [MDAC]
compiler: [MSVC]
build_type: [Debug, Release]
architecture: [x86, x64]
runtime_link: [dynamic-runtime]
third_parties: [bundled-third-parties]
runs-on: ${{ matrix.os }}
steps:
- name: Create directories
working-directory: ${{ github.workspace }}
run: |
new-item ${{ github.workspace }}/run -itemtype directory
new-item ${{ github.workspace }}/build -itemtype directory
new-item ${{ github.workspace }}/prefix -itemtype directory
new-item ${{ github.workspace }}/install -itemtype directory
new-item ${{ github.workspace }}/package -itemtype directory
- name: Clone the repo
uses: actions/checkout@v2
with:
path: source
submodules: true
- name: Set up Visual Studio shell
uses: egor-tensin/vs-shell@v2
with:
arch: ${{ matrix.architecture }}
# - name: Install dependencies - Docker
# if: ${{ matrix.os != 'windows-2016' }}
# run: |
# choco install wsl2 --params "/Version:2 /Retry:true" --yes
# choco install docker-desktop --yes
# & "C:\Program Files\Docker\Docker\Docker Desktop.exe"
- name: Configure
run: >
cmake -S ${{ github.workspace }}/source -B ${{ github.workspace }}/build
-A ${{ fromJSON('{"x86": "Win32", "x64": "x64"}')[matrix.architecture] }}
-DCMAKE_SYSTEM_VERSION="${{ fromJSON('{"windows-2016": "10.0.17763.0", "windows-2019": "10.0.19041.685"}')[matrix.os] }}"
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DODBC_PROVIDER=${{ matrix.odbc_provider }}
-DCH_ODBC_RUNTIME_LINK_STATIC=${{ fromJSON('{"static-runtime": "ON", "dynamic-runtime": "OFF"}')[matrix.runtime_link] }}
-DCH_ODBC_PREFER_BUNDLED_THIRD_PARTIES=${{ fromJSON('{"bundled-third-parties": "ON", "system-third-parties": "OFF"}')[matrix.third_parties] }}
-DTEST_DSN_LIST="ClickHouse DSN (ANSI);ClickHouse DSN (Unicode);ClickHouse DSN (ANSI, RBWNAT)"
- name: Build
run: cmake --build ${{ github.workspace }}/build --config ${{ matrix.build_type }}
- name: Package
run: cmake --build ${{ github.workspace }}/build --config ${{ matrix.build_type }} --target package
- name: List artifacts
run: |
echo REF: ${{ github.ref }}
dir ${{ github.workspace }}/build
- name: Upload the artifacts
# if: ${{ matrix.os == 'windows-2019' && matrix.build_type == 'Release' }}
uses: actions/upload-artifact@v3
with:
name: clickhouse-odbc-windows-${{ matrix.architecture }}-${{ matrix.build_type }}
path: ${{ github.workspace }}/build/clickhouse-odbc-*
- name: Test - Run unit tests
working-directory: ${{ github.workspace }}/build
run: ctest --output-on-failure --build-config ${{ matrix.build_type }} -R '.*-ut.*'
# - name: Test - Start ClickHouse server in background
# if: ${{ matrix.os != 'windows-2016' }}
# run: |
# docker pull ${env:CLICKHOUSE_SERVER_IMAGE}
# docker run -d --name clickhouse ${env:CLICKHOUSE_SERVER_IMAGE}
# docker ps -a
# docker stats -a --no-stream
# - name: Test - Run integration tests
# if: ${{ matrix.os != 'windows-2016' }}
# working-directory: ${{ github.workspace }}/build
# run: |
# export CLICKHOUSE_SERVER_IP=$(docker inspect -f '{{ .NetworkSettings.IPAddress }}' clickhouse)
# export ODBCSYSINI=${{ github.workspace }}/run
# export ODBCINSTINI=.odbcinst.ini
# export ODBCINI=$ODBCSYSINI/.odbc.ini
# if [[ "${{ matrix.odbc_provider }}" == "iODBC" ]]; then
# # Full path to a custom odbcinst.ini in ODBCINSTINI for iODBC.
# export ODBCINSTINI=$ODBCSYSINI/$ODBCINSTINI
# fi
# cat > $ODBCSYSINI/.odbcinst.ini <<-EOF
# [ODBC]
# Trace = 1
# TraceFile = ${{ github.workspace }}/run/odbc-driver-manager-trace.log
# Debug = 1
# DebugFile = ${{ github.workspace }}/run/odbc-driver-manager-debug.log
# [ODBC Drivers]
# ClickHouse ODBC Driver (ANSI) = Installed
# ClickHouse ODBC Driver (Unicode) = Installed
# [ClickHouse ODBC Driver (ANSI)]
# Driver = ${{ github.workspace }}/build/driver/libclickhouseodbc.so
# Setup = ${{ github.workspace }}/build/driver/libclickhouseodbc.so
# UsageCount = 1
# [ClickHouse ODBC Driver (Unicode)]
# Driver = ${{ github.workspace }}/build/driver/libclickhouseodbcw.so
# Setup = ${{ github.workspace }}/build/driver/libclickhouseodbcw.so
# UsageCount = 1
# EOF
# cat > $ODBCSYSINI/.odbc.ini <<-EOF
# [ODBC]
# Trace = 1
# TraceFile = ${{ github.workspace }}/run/odbc-driver-manager-trace.log
# Debug = 1
# DebugFile = ${{ github.workspace }}/run/odbc-driver-manager-debug.log
# [ODBC Data Sources]
# ClickHouse DSN (ANSI) = ClickHouse ODBC Driver (ANSI)
# ClickHouse DSN (Unicode) = ClickHouse ODBC Driver (Unicode)
# ClickHouse DSN (ANSI, RBWNAT) = ClickHouse ODBC Driver (ANSI)
# [ClickHouse DSN (ANSI)]
# Driver = ClickHouse ODBC Driver (ANSI)
# Description = Test DSN for ClickHouse ODBC Driver (ANSI)
# Url = http://${CLICKHOUSE_SERVER_IP}
# DriverLog = yes
# DriverLogFile = ${{ github.workspace }}/run/clickhouse-odbc-driver.log
# [ClickHouse DSN (Unicode)]
# Driver = ClickHouse ODBC Driver (Unicode)
# Description = Test DSN for ClickHouse ODBC Driver (Unicode)
# Url = http://${CLICKHOUSE_SERVER_IP}
# DriverLog = yes
# DriverLogFile = ${{ github.workspace }}/run/clickhouse-odbc-driver-w.log
# [ClickHouse DSN (ANSI, RBWNAT)]
# Driver = ClickHouse ODBC Driver (ANSI)
# Description = Test DSN for ClickHouse ODBC Driver (ANSI) that uses RowBinaryWithNamesAndTypes as data source communication default format
# Url = http://${CLICKHOUSE_SERVER_IP}/query?default_format=RowBinaryWithNamesAndTypes
# DriverLog = yes
# DriverLogFile = ${{ github.workspace }}/run/clickhouse-odbc-driver.log
# EOF
# if [[ "${{ matrix.odbc_provider }}" == "iODBC" ]]; then
# export GTEST_FILTER="-PerformanceTest.*"
# fi
# # Run all tests except those that were run in "Test - unit tests" step.
# ctest --output-on-failure --build-config ${{ matrix.build_type }} -E '.*-ut.*'
- name: Upload artifacts as release assets
if: ${{ github.event_name == 'release' && matrix.build_type == 'Release' }}
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ github.workspace }}/build/clickhouse-odbc-*
overwrite: true
tag: ${{ github.ref }}
file_glob: true