-
Notifications
You must be signed in to change notification settings - Fork 345
305 lines (267 loc) · 8.39 KB
/
tests.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
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
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
name: build
on:
push:
branches:
- master
pull_request:
branches:
- master
permissions:
contents: read
jobs:
tests:
name: UTs ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
check-latest: true
go-version-file: 'go.mod'
- name: Test
run: go run build/make.go --test --verbose
lsp-tests:
needs: tests
name: lsp-tests ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest]
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
check-latest: true
go-version-file: 'go.mod'
- name: Set up Nodejs
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
cache-dependency-path: 'build/npm/package-lock.json'
- name: Build
run: |
go run build/make.go --verbose
- name: Clone LSP tests
run: |
git clone https://github.com/getgauge/gauge-lsp-tests
cd gauge-lsp-tests
npm install
- name: Install Gauge (windows)
if: matrix.os == 'windows-latest'
run: |
go run build/make.go --install --verbose
echo "C:\\Program Files\\gauge\\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Install Gauge (linux)
if: matrix.os != 'windows-latest'
run: |
go run build/make.go --install --prefix=/tmp/gauge --verbose
echo "/tmp/gauge/bin" >> $GITHUB_PATH
- name: Add js_simple template
run: |
gauge template js_simple https://github.com/getgauge/template-js-simple/releases/latest/download/js_simple.zip
- name: Prep gauge-js
run: |
git clone https://github.com/getgauge/gauge-js.git
cd gauge-js
npm install
shell: bash
- name: Install gauge-js
run: |
cd gauge-js
npm run installPlugin
- name: Run lsp-tests
run: |
cd gauge-lsp-tests
gauge install
gauge run --tags="!knownIssue & (actions_on_project_load | actions_on_file_edit)" --env=js-wd
functional-tests:
needs: tests
name: FTs ${{ matrix.os }}
runs-on: ${{ matrix.os }}
env:
TAGS: js
strategy:
matrix:
os: [windows-latest, ubuntu-latest]
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
check-latest: true
go-version-file: 'go.mod'
- name: Setup java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
- name: Build
run: go run build/make.go --verbose
- name: Install Gauge (windows)
if: matrix.os == 'windows-latest'
run: |
go run build/make.go --install --verbose
echo "C:\\Program Files\\gauge\\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Install Gauge (linux)
if: matrix.os != 'windows-latest'
run: |
go run build/make.go --install --prefix=/tmp/gauge --verbose
echo "/tmp/gauge/bin" >> $GITHUB_PATH
- name: Add js_simple template
run: |
gauge template js_simple https://github.com/getgauge/template-js-simple/releases/latest/download/js_simple.zip
- name: Clone gauge-java
run: |
git clone https://github.com/getgauge/gauge-java
- name: Install Gauge Java plugin from source
run: |
cd gauge-java
go run build/make.go && go run build/make.go --install
- name: Install Gauge Java maven package locally
run: |
cd gauge-java
mvn -q install -DskipTests -"Dgpg.skip" -D"maven.javadoc.skip=true"
- name: Prep gauge-js
run: |
git clone https://github.com/getgauge/gauge-js.git
cd gauge-js
npm install
shell: bash
- name: Install gauge-js
run: |
cd gauge-js
npm run installPlugin
- name: Prep html-report
run: |
git clone https://github.com/getgauge/html-report
cd html-report
go run build/make.go && go run build/make.go --install
shell: bash
- name: Prep FTs
run: |
git clone https://github.com/getgauge/gauge-tests
cd gauge-tests
gauge install
- name: Install gauge and Run FTs (windows)
if: matrix.os == 'windows-latest'
run: |
cd gauge-tests
.\gradlew.bat clean jsFT
shell: pwsh
- name: Install gauge and Run FTs (linux/osx)
if: matrix.os != 'windows-latest'
run: |
cd gauge-tests
./gradlew clean jsFT
- name: Upload logs
uses: actions/upload-artifact@v4
if: failure()
with:
name: ft-logs-${{ matrix.os }}
path: gauge-tests/logs
build:
name: Build ${{ matrix.os }} artifacts
runs-on: ${{ matrix.os }}
needs: [ functional-tests, lsp-tests ]
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
check-latest: true
go-version-file: 'go.mod'
- name: Build distro for ${{ matrix.os }}
run: go run build/make.go && go run build/make.go --distro
- name: Upload artifacts for ${{ matrix.os }}
uses: actions/upload-artifact@v4
with:
name: gauge-artifact-for-${{ matrix.os }}
path: deploy
benchmark:
name: Benchmark ${{ matrix.project }} | PARALLEL= ${{ matrix.parallel }}
runs-on: ubuntu-latest
needs: [ functional-tests, lsp-tests ]
if: github.event_name == 'pull_request'
strategy:
matrix:
project: [java_simple, java_maven, java_gradle]
parallel: ['parallel', 'serial', 'multithreaded']
env:
BENCHMARK_OUT_DIR: "../out"
steps:
- uses: actions/checkout@v4
with:
path: gauge
- name: Set up Go
uses: actions/setup-go@v5
with:
check-latest: true
go-version-file: 'gauge/go.mod'
cache-dependency-path: 'gauge/go.sum'
- name: Setup java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
- name: Install Gauge
run: |
cd gauge
go run build/make.go && go run build/make.go --install --prefix=/tmp/gauge --verbose
echo "/tmp/gauge/bin" >> $GITHUB_PATH
- name: Install gauge-java
run: gauge install java
- name: Prep benchmark
uses: actions/checkout@v4
with:
repository: getgauge/gauge-benchmarks
path: gauge-benchmarks
ref: master
- name: Run benchmark ${{matrix.project}} | ${{matrix.parallel}}
id: benchmark_run
env:
PARALLEL: ${{ matrix.parallel != 'serial' }}
enable_multithreading: ${{ matrix.parallel == 'multithreaded' }}
run: |
mkdir -p gauge-benchmarks/out
cd gauge-benchmarks/${{ matrix.project }}
./run.sh
- name: Upload benchmark
uses: actions/upload-artifact@v4
with:
name: ${{matrix.project}}_${{matrix.parallel}}
path: gauge-benchmarks/out
post_result_as_artifact:
name: Aggregate and upload benchmark result as artifact.
runs-on: ubuntu-latest
needs: benchmark
if: github.event_name == 'pull_request'
steps:
- name: Prep benchmark
uses: actions/checkout@v4
with:
repository: getgauge/gauge-benchmarks
path: gauge-benchmarks
ref: master
- name: Download benchmark results
uses: actions/download-artifact@v4
with:
path: gauge-benchmarks/out/
- name: Generate Comment String
id: gen_comment_str
run: |
cd gauge-benchmarks
./generate_summary.sh > out/results.md
- name: Publish Benchmark Result
uses: actions/upload-artifact@v4
with:
name: benchmark
path: gauge-benchmarks/out/results.md