-
Notifications
You must be signed in to change notification settings - Fork 10
196 lines (180 loc) · 6.12 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
name: Go_WINDOWS
on:
pull_request:
branches:
- 'main'
- '3.0'
- '3.1'
- '3.1.2'
push:
branches:
- 'main'
- '3.0'
- '3.1'
- '3.1.2'
workflow_dispatch:
inputs:
tbBranch:
description: 'TDengine branch'
required: true
type: string
jobs:
build:
runs-on: windows-2022
name: build TDengine
outputs:
commit_id: ${{ steps.get_commit_id.outputs.commit_id }}
steps:
- name: checkout TDengine by pr
if: github.event_name == 'pull_request'
uses: actions/checkout@v4
with:
repository: 'taosdata/TDengine'
ref: ${{ github.base_ref }}
- name: checkout TDengine by push
if: github.event_name == 'push'
uses: actions/checkout@v4
with:
repository: 'taosdata/TDengine'
ref: ${{ github.ref_name }}
- name: checkout TDengine manually
if: github.event_name == 'workflow_dispatch'
uses: actions/checkout@v4
with:
repository: 'taosdata/TDengine'
ref: ${{ inputs.tbBranch }}
- name: get_commit_id
id: get_commit_id
run: |
echo "::set-output name=commit_id::$(git rev-parse HEAD)"
- name: Cache server by pr
if: github.event_name == 'pull_request'
id: cache-server-pr
uses: actions/cache@v4
with:
path: C:/TDengine
key: ${{ runner.os }}-build-${{ github.base_ref }}-${{ steps.get_commit_id.outputs.commit_id }}
- name: Cache server by pr
if: github.event_name == 'push'
id: cache-server-push
uses: actions/cache@v4
with:
path: C:/TDengine
key: ${{ runner.os }}-build-${{ github.ref_name }}-${{ steps.get_commit_id.outputs.commit_id }}
- name: Cache server manually
if: github.event_name == 'workflow_dispatch'
id: cache-server-manually
uses: actions/cache@v4
with:
path: C:/TDengine
key: ${{ runner.os }}-build-${{ inputs.tbBranch }}-${{ steps.get_commit_id.outputs.commit_id }}
- name: install jom
if: >
(github.event_name == 'workflow_dispatch' && steps.cache-server-manually.outputs.cache-hit != 'true') ||
(github.event_name == 'pull_request' && steps.cache-server-pr.outputs.cache-hit != 'true') ||
(github.event_name == 'push' && steps.cache-server-push.outputs.cache-hit != 'true')
shell: powershell
run: |
Start-BitsTransfer -Source http://download.qt.io/official_releases/jom/jom.zip
7z x jom.zip
- name: install TDengine
if: >
(github.event_name == 'workflow_dispatch' && steps.cache-server-manually.outputs.cache-hit != 'true') ||
(github.event_name == 'pull_request' && steps.cache-server-pr.outputs.cache-hit != 'true') ||
(github.event_name == 'push' && steps.cache-server-push.outputs.cache-hit != 'true')
shell: cmd
run: |
set PATH=%PATH%;%cd%
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
mkdir debug
cd debug
cmake .. -G "NMake Makefiles JOM" -DBUILD_HTTP=true -DBUILD_TOOLS=false -DBUILD_TEST=off
jom.exe
jom.exe install
test_build:
needs: build
runs-on: windows-2022
strategy:
matrix:
go: [ '1.20' ]
name: Go ${{ matrix.go }}
steps:
- name: get cache server by pr
if: github.event_name == 'pull_request'
id: get-cache-server-pr
uses: actions/cache@v4
with:
path: C:/TDengine
key: ${{ runner.os }}-build-${{ github.base_ref }}-${{ needs.build.outputs.commit_id }}
restore-keys: |
${{ runner.os }}-build-${{ github.base_ref }}-
- name: get cache server by push
if: github.event_name == 'push'
id: get-cache-server-push
uses: actions/cache@v4
with:
path: C:/TDengine
key: ${{ runner.os }}-build-${{ github.ref_name }}-${{ needs.build.outputs.commit_id }}
restore-keys: |
${{ runner.os }}-build-${{ github.ref_name }}-
- name: cache server manually
if: github.event_name == 'workflow_dispatch'
id: get-cache-server-manually
uses: actions/cache@v4
with:
path: C:/TDengine
key: ${{ runner.os }}-build-${{ inputs.tbBranch }}-${{ needs.build.outputs.commit_id }}
restore-keys: |
${{ runner.os }}-build-${{ inputs.tbBranch }}-
- name: checkout
uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
cache-dependency-path: go.sum
- name: build taosadapter
run: go build
# test_go:
# needs: build
# runs-on: windows-2022
# strategy:
# matrix:
# go: [ '1.19' ]
# name: Go ${{ matrix.go }}
# steps:
# - name: get cache server by pr
# if: github.event_name == 'pull_request'
# id: get-cache-server-pr
# uses: actions/cache@v4
# with:
# path: C:/TDengine
# key: ${{ runner.os }}-build-${{ github.base_ref }}-${{ needs.build.outputs.commit_id }}
# restore-keys: |
# ${{ runner.os }}-build-${{ github.base_ref }}-
#
# - name: cache server manually
# if: github.event_name == 'workflow_dispatch'
# id: get-cache-server-manually
# uses: actions/cache@v4
# with:
# path: C:/TDengine
# key: ${{ runner.os }}-build-${{ inputs.tbBranch }}-${{ needs.build.outputs.commit_id }}
# restore-keys: |
# ${{ runner.os }}-build-${{ inputs.tbBranch }}-
#
# - name: checkout
# uses: actions/checkout@v4
#
# - uses: actions/setup-go@v4
# with:
# go-version: ${{ matrix.go }}
# cache-dependency-path: go.sum
#
# - name: run TDengine and test
# shell: cmd
# env:
# TAOS_SUPPORT_VNODES: 256
# run: |
# set PATH=%PATH%;C:\TDengine\driver
# start /b C:/TDengine/taosd.exe > log.txt
# go test -v --count=1 ./...