-
Notifications
You must be signed in to change notification settings - Fork 65
318 lines (309 loc) · 10.1 KB
/
ci.yml
File metadata and controls
318 lines (309 loc) · 10.1 KB
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
306
307
308
309
310
311
312
313
314
315
316
317
318
name: build
on:
pull_request:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up python 3.11
uses: actions/setup-python@v6
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements_dev.txt
- name: Lint and format check with ruff
run: |
ruff check .
ruff format --check .
tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13']
fail-fast: false
steps:
- uses: actions/checkout@v6
- name: Set up python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements_ai.txt
pip install -r requirements_dev.txt
python -m spacy download en_core_web_md
- name: Test with pytest and coverage
env:
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
AZURE_OPENAI_ENDPOINT: ${{ secrets.AZURE_OPENAI_ENDPOINT }}
OPENAI_API_VERSION: ${{ secrets.OPENAI_API_VERSION }}
run: |
coverage run --source=toolium -m pytest toolium/test
- name: Publish on coveralls.io
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: Python ${{ matrix.python-version }}
COVERALLS_PARALLEL: true
run: |
coveralls --service=github
coveralls:
needs: tests
runs-on: ubuntu-latest
steps:
- name: Set up python 3.13
uses: actions/setup-python@v6
with:
python-version: '3.13'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade coveralls
- name: Finalize publishing on coveralls.io
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
coveralls --finish
examples-behave-tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13']
fail-fast: false
steps:
- name: Checkout toolium repository
uses: actions/checkout@v6
- name: Checkout toolium-examples repository
uses: actions/checkout@v6
with:
repository: Telefonica/toolium-examples
ref: refs/heads/master
path: toolium-examples
- name: Set up python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install toolium dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Install toolium
run: |
python -m pip install .
- name: Install toolium-examples dependencies
run: |
cd toolium-examples
pip install -r requirements.txt
- name: Run tests
env:
TOOLIUM_DRIVER_HEADLESS: Driver_headless=true
run: |
cd toolium-examples
behave web_behave/features/ --junit --junit-directory web_behave/output/reports --tags=~@skip
continue-on-error: true
- name: Upload output folder
uses: actions/upload-artifact@v7
if: always()
with:
name: behave-tests-output-${{ matrix.python-version }}
path: toolium-examples/web_behave/output
- name: Publish test results
uses: dorny/test-reporter@v3
if: always()
with:
name: behave tests results (${{ matrix.python-version }})
path: toolium-examples/web_behave/output/reports/*.xml
reporter: java-junit
fail-on-error: true
examples-pytest-tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13']
fail-fast: false
steps:
- name: Checkout toolium repository
uses: actions/checkout@v6
- name: Checkout toolium-examples repository
uses: actions/checkout@v6
with:
repository: Telefonica/toolium-examples
ref: refs/heads/master
path: toolium-examples
- name: Set up python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install toolium dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Install toolium
run: |
python -m pip install .
- name: Install toolium-examples dependencies
run: |
cd toolium-examples
pip install -r requirements.txt
- name: Run tests
env:
TOOLIUM_DRIVER_HEADLESS: Driver_headless=true
run: |
cd toolium-examples/web_pytest
python -m pytest --junitxml=output/reports/junit-pytest.xml
continue-on-error: true
- name: Upload output folder
uses: actions/upload-artifact@v7
if: always()
with:
name: pytest-tests-output-${{ matrix.python-version }}
path: toolium-examples/web_pytest/output
- name: Publish test results
uses: dorny/test-reporter@v3
if: always()
with:
name: pytest tests results (${{ matrix.python-version }})
path: toolium-examples/web_pytest/output/reports/*.xml
reporter: java-junit
fail-on-error: true
examples-nose2-tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13']
fail-fast: false
steps:
- name: Checkout toolium repository
uses: actions/checkout@v6
- name: Checkout toolium-examples repository
uses: actions/checkout@v6
with:
repository: Telefonica/toolium-examples
ref: refs/heads/master
path: toolium-examples
- name: Set up python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install toolium dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Install toolium
run: |
python -m pip install .
- name: Install toolium-examples dependencies
run: |
cd toolium-examples
pip install -r requirements.txt
- name: Run tests
env:
TOOLIUM_DRIVER_HEADLESS: Driver_headless=true
run: |
cd toolium-examples
mkdir -p web_nose2/output/reports
python -m nose2 web_nose2 -A '!local' --junit-xml-path web_nose2/output/reports/junit-nose.xml
continue-on-error: true
- name: Upload output folder
uses: actions/upload-artifact@v7
if: always()
with:
name: nose2-tests-output-${{ matrix.python-version }}
path: toolium-examples/web_nose2/output
- name: Publish test results
uses: dorny/test-reporter@v3
if: always()
with:
name: nose2 tests results (${{ matrix.python-version }})
path: toolium-examples/web_nose2/output/reports/*.xml
reporter: java-junit
fail-on-error: true
examples-playwright-tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13']
fail-fast: false
steps:
- name: Checkout toolium repository
uses: actions/checkout@v6
- name: Checkout toolium-examples repository
uses: actions/checkout@v6
with:
repository: Telefonica/toolium-examples
ref: refs/heads/master
path: toolium-examples
- name: Set up python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install toolium dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Install toolium
run: |
python -m pip install .
- name: Install toolium-examples dependencies
run: |
cd toolium-examples
pip install -r requirements.txt
playwright install
- name: Run tests
env:
TOOLIUM_DRIVER_HEADLESS: Driver_headless=true
run: |
cd toolium-examples
behave web_playwright_behave/features --junit --junit-directory web_playwright_behave/output/reports/ --tags=~@skip
continue-on-error: true
- name: Upload output folder
uses: actions/upload-artifact@v7
if: always()
with:
name: playwright-tests-output-${{ matrix.python-version }}
path: toolium-examples/web_playwright_behave/output
- name: Publish test results
uses: dorny/test-reporter@v3
if: always()
with:
name: playwright tests results (${{ matrix.python-version }})
path: toolium-examples/web_playwright_behave/output/reports/*.xml
reporter: java-junit
fail-on-error: true
combine-output-artifacts:
runs-on: ubuntu-latest
needs: [examples-behave-tests, examples-pytest-tests, examples-nose2-tests, examples-playwright-tests]
if: always()
steps:
- name: Download all artifacts
uses: actions/download-artifact@v5
with:
path: all-artifacts
- name: Create combined structure
run: |
mkdir -p tests-output
echo "=== Downloaded artifacts ==="
ls -la all-artifacts/
# Organize by framework and python version
for framework in behave pytest nose2 playwright; do
mkdir -p "tests-output/$framework"
for version in 3.10 3.11 3.12 3.13; do
if [ -d "all-artifacts/${framework}-tests-output-${version}" ]; then
echo "Moving $framework python $version output..."
mv "all-artifacts/${framework}-tests-output-${version}" "tests-output/$framework/python-${version}"
fi
done
done
echo "=== Combined structure ==="
tree tests-output || find tests-output -type d
echo "=== Total files ==="
find tests-output -type f | wc -l
- name: Upload combined output artifacts
uses: actions/upload-artifact@v7
with:
name: tests-output
path: tests-output/