forked from microsoft/delta-kusto
-
Notifications
You must be signed in to change notification settings - Fork 0
273 lines (257 loc) · 10.9 KB
/
exec-test.yaml
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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
name: Exec tests
on:
workflow_dispatch:
inputs:
outOfProc:
required: true
default: true
description: 'Execute Delta Kusto out-of-proc: true or false'
jobs:
clusterSetup:
runs-on: ubuntu-latest
steps:
# Login
- name: Azure Login
run: az login --service-principal -u ${{ secrets.test_deploy_sp_id }} -p ${{ secrets.test_deploy_sp_secret }} --tenant ${{ secrets.test_tenant_id }}
# Add Kusto extension to Azure CLI
- name: Install Kusto extension
run: az extension add -n kusto
# Turn cluster on
- name: Turn on cluster (if off)
run: |
# Retrieve cluster name
clusterName=$(az kusto cluster list -g ${{ secrets.test_rg }} --query "[?tags.testLevel=='integration'].name" -o tsv)
state=$(az kusto cluster list -g ${{ secrets.test_rg }} --query "[?tags.testLevel=='integration'].state" -o tsv)
echo "Cluster Name: $clusterName"
echo "State: $state"
if [ "$state" == "Stopped" ]
then
# Actually start the cluster
echo "Start cluster"
az kusto cluster start -n $clusterName -g ${{ secrets.test_rg }} -n $clusterName
else
echo "Do nothing"
fi
linux:
needs:
- clusterSetup
runs-on: ubuntu-latest
env:
# See OS catalog here: https://docs.microsoft.com/en-us/dotnet/core/rid-catalog
dotnetOs: linux-x64
exec: delta-kusto
deltaDbPrefix: github_linux_
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.x
# See https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-restore
- name: Install dependencies
shell: bash
run: dotnet restore code
# See https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-build
- name: Build
shell: bash
run: dotnet build code --configuration Release --no-restore
# See https://github.com/dotnet/designs/blob/main/accepted/2020/single-file/design.md#user-experience
# & https://docs.microsoft.com/en-us/dotnet/core/deploying/single-file
# & https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-publish
- name: Build single file executable
shell: bash
run: |
dotnet publish code/delta-kusto -c release -r $dotnetOs --self-contained \
-p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true \
-p:PublishTrimmed=true -p:PublishReadyToRun=true \
-o bin
- name: Observe binaries
run: ls -l bin
- name: Azure CLI Version
run: az version
# Login
- name: Azure Login
run: az login --service-principal -u ${{ secrets.test_deploy_sp_id }} -p ${{ secrets.test_deploy_sp_secret }} --tenant ${{ secrets.test_tenant_id }}
- name: CLI Kusto Extension
run: az extension add -n kusto
# Set environment variables
- name: Set environment variables
shell: bash
run: |
# Fetch cluster context
clusterUri=$(az kusto cluster list -g ${{ secrets.test_rg }} --query "[?tags.testLevel=='integration'].uri" -o tsv)
deltaKustoSingleExecPath="$(pwd)/bin/$exec"
echo "Cluster Uri: $clusterUri"
echo "Exec path: $deltaKustoSingleExecPath"
echo "Delta DBs prefix: $deltaDbPrefix"
# Exec path
if [ ${{ github.event.inputs.outOfProc }} == "true" ]
then
echo "deltaKustoSingleExecPath=$deltaKustoSingleExecPath" >> $GITHUB_ENV
fi
# ADX integration
echo "deltaKustoClusterUri=$clusterUri" >> $GITHUB_ENV
echo "deltaKustoDbPrefix=$deltaDbPrefix" >> $GITHUB_ENV
echo "deltaKustoTenantId=${{ secrets.test_tenant_id }}" >> $GITHUB_ENV
echo "deltaKustoSpId=${{ secrets.tester_sp_id }}" >> $GITHUB_ENV
echo "deltaKustoSpSecret=${{ secrets.tester_sp_secret }}" >> $GITHUB_ENV # See https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-test
- name: File-based integration tests (out-of-proc)
shell: bash
run: |
dotnet test code/DeltaKustoFileIntegrationTest \
--configuration Release --no-build --verbosity normal
# See https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-test
- name: ADX-based integration tests (out-of-proc)
shell: bash
run: |
dotnet test code/DeltaKustoAdxIntegrationTest \
--configuration Release --no-build --verbosity normal
mac:
needs:
- clusterSetup
# This can run in parallel with the other job as they target different databases
runs-on: macos-latest
env:
# See OS catalog here: https://docs.microsoft.com/en-us/dotnet/core/rid-catalog
dotnetOs: osx-x64
exec: delta-kusto
deltaDbPrefix: github_mac_os_
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.x
# See https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-restore
- name: Install dependencies
shell: bash
run: dotnet restore code
# See https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-build
- name: Build
shell: bash
run: dotnet build code --configuration Release --no-restore
# See https://github.com/dotnet/designs/blob/main/accepted/2020/single-file/design.md#user-experience
# & https://docs.microsoft.com/en-us/dotnet/core/deploying/single-file
# & https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-publish
- name: Build single file executable
shell: bash
run: |
dotnet publish code/delta-kusto -c release -r $dotnetOs --self-contained \
-p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true \
-p:PublishTrimmed=true -p:PublishReadyToRun=true \
-o bin
- name: Observe binaries
run: ls -l bin
- name: Azure CLI Version
run: az version
# Login
- name: Azure Login
run: az login --service-principal -u ${{ secrets.test_deploy_sp_id }} -p ${{ secrets.test_deploy_sp_secret }} --tenant ${{ secrets.test_tenant_id }}
- name: CLI Kusto Extension
run: az extension add -n kusto
# Set environment variables
- name: Set environment variables
shell: bash
run: |
# Fetch cluster context
clusterUri=$(az kusto cluster list -g ${{ secrets.test_rg }} --query "[?tags.testLevel=='integration'].uri" -o tsv)
deltaKustoSingleExecPath="$(pwd)/bin/$exec"
echo "Cluster Uri: $clusterUri"
echo "Exec path: $deltaKustoSingleExecPath"
echo "Delta DBs prefix: $deltaDbPrefix"
# Exec path
if [ ${{ github.event.inputs.outOfProc }} == "true" ]
then
echo "deltaKustoSingleExecPath=$deltaKustoSingleExecPath" >> $GITHUB_ENV
fi
# ADX integration
echo "deltaKustoClusterUri=$clusterUri" >> $GITHUB_ENV
echo "deltaKustoDbPrefix=$deltaDbPrefix" >> $GITHUB_ENV
echo "deltaKustoTenantId=${{ secrets.test_tenant_id }}" >> $GITHUB_ENV
echo "deltaKustoSpId=${{ secrets.tester_sp_id }}" >> $GITHUB_ENV
echo "deltaKustoSpSecret=${{ secrets.tester_sp_secret }}" >> $GITHUB_ENV # See https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-test
- name: File-based integration tests (out-of-proc)
shell: bash
run: |
dotnet test code/DeltaKustoFileIntegrationTest \
--configuration Release --no-build --verbosity normal
# See https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-test
- name: ADX-based integration tests (out-of-proc)
shell: bash
run: |
dotnet test code/DeltaKustoAdxIntegrationTest \
--configuration Release --no-build --verbosity normal
windows:
needs:
- clusterSetup
runs-on: windows-latest
env:
# See OS catalog here: https://docs.microsoft.com/en-us/dotnet/core/rid-catalog
dotnetOs: win-x64
exec: delta-kusto.exe
deltaDbPrefix: github_win_
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.x
# See https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-restore
- name: Install dependencies
shell: bash
run: dotnet restore code
# See https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-build
- name: Build
shell: bash
run: dotnet build code --configuration Release --no-restore
# See https://github.com/dotnet/designs/blob/main/accepted/2020/single-file/design.md#user-experience
# & https://docs.microsoft.com/en-us/dotnet/core/deploying/single-file
# & https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-publish
- name: Build single file executable
shell: bash
run: |
dotnet publish code/delta-kusto -c release -r $dotnetOs --self-contained \
-p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true \
-p:PublishTrimmed=true -p:PublishReadyToRun=true \
-o bin
- name: Observe binaries
run: ls -l bin
- name: Azure CLI Version
run: az version
# Login
- name: Azure Login
run: az login --service-principal -u ${{ secrets.test_deploy_sp_id }} -p ${{ secrets.test_deploy_sp_secret }} --tenant ${{ secrets.test_tenant_id }}
- name: CLI Kusto Extension
run: az extension add -n kusto
# Set environment variables
- name: Set environment variables
shell: bash
run: |
# Fetch cluster context
clusterUri=$(az kusto cluster list -g ${{ secrets.test_rg }} --query "[?tags.testLevel=='integration'].uri" -o tsv)
deltaKustoSingleExecPath="$(pwd)/bin/$exec"
echo "Cluster Uri: $clusterUri"
echo "Exec path: $deltaKustoSingleExecPath"
echo "Delta DBs prefix: $deltaDbPrefix"
# Exec path
if [ ${{ github.event.inputs.outOfProc }} == "true" ]
then
echo "deltaKustoSingleExecPath=$deltaKustoSingleExecPath" >> $GITHUB_ENV
fi
# ADX integration
echo "deltaKustoClusterUri=$clusterUri" >> $GITHUB_ENV
echo "deltaKustoDbPrefix=$deltaDbPrefix" >> $GITHUB_ENV
echo "deltaKustoTenantId=${{ secrets.test_tenant_id }}" >> $GITHUB_ENV
echo "deltaKustoSpId=${{ secrets.tester_sp_id }}" >> $GITHUB_ENV
echo "deltaKustoSpSecret=${{ secrets.tester_sp_secret }}" >> $GITHUB_ENV # See https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-test
- name: File-based integration tests (out-of-proc)
shell: bash
run: |
dotnet test code/DeltaKustoFileIntegrationTest \
--configuration Release --no-build --verbosity normal
# See https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-test
- name: ADX-based integration tests (out-of-proc)
shell: bash
run: |
dotnet test code/DeltaKustoAdxIntegrationTest \
--configuration Release --no-build --verbosity normal