Skip to content

Commit 55f3537

Browse files
committed
publish es
Signed-off-by: Anas Nashif <[email protected]>
1 parent e067742 commit 55f3537

File tree

2 files changed

+48
-25
lines changed

2 files changed

+48
-25
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Twister Test Results
2+
3+
on:
4+
workflow_run:
5+
workflows: ["Run tests with twister"]
6+
branches:
7+
- main
8+
- v*
9+
types:
10+
- completed
11+
12+
jobs:
13+
upload-to-elasticsearch:
14+
env:
15+
ELASTICSEARCH_KEY: ${{ secrets.ELASTICSEARCH_KEY }}
16+
ELASTICSEARCH_SERVER: "https://elasticsearch.zephyrproject.io:443"
17+
runs-on: ubuntu-22.04
18+
steps:
19+
# Needed for elasticearch and upload script
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
persist-credentials: false
25+
26+
- name: Download Artifacts
27+
uses: dawidd6/action-download-artifact@v6
28+
with:
29+
path: artifacts
30+
workflow: twister.yml
31+
run_id: ${{ github.event.workflow_run.id }}
32+
33+
- name: Upload to elasticsearch
34+
run: |
35+
pip3 install elasticsearch
36+
# set run date on upload to get consistent and unified data across the matrix.
37+
run_date=`date --iso-8601=minutes`
38+
if [ "${{github.event_name}}" = "push" ]; then
39+
python3 ./scripts/ci/upload_test_results_es.py -r ${run_date} \
40+
--run-attempt ${{github.run_attempt}} \
41+
--index zephyr-main-ci-push-1 artifacts/*/*/twister.json
42+
elif [ "${{github.event_name}}" = "schedule" ]; then
43+
python3 ./scripts/ci/upload_test_results_es.py -r ${run_date} \
44+
--run-attempt ${{github.run_attempt}} \
45+
--index zephyr-main-ci-weekly-1 artifacts/*/*/twister.json
46+
fi

.github/workflows/twister.yaml

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
rundate: ${{ steps.output-services.outputs.rundate }}
3232
env:
3333
MATRIX_SIZE: 10
34-
PUSH_MATRIX_SIZE: 5
34+
PUSH_MATRIX_SIZE: 1
3535
DAILY_MATRIX_SIZE: 80
3636
BSIM_OUT_PATH: /opt/bsim/
3737
BSIM_COMPONENTS_PATH: /opt/bsim/components
@@ -237,7 +237,7 @@ jobs:
237237
export ZEPHYR_BASE=${PWD}
238238
export ZEPHYR_TOOLCHAIN_VARIANT=zephyr
239239
./scripts/twister -T tests/kernel/threads -p qemu_x86 --subset ${{matrix.subset}}/${{ strategy.job-total }} ${TWISTER_COMMON} ${PUSH_OPTIONS}
240-
if [ "${{matrix.subset}}" = "1" ]; then
240+
if [ "${{matrix.subset}}" = "11" ]; then
241241
./scripts/zephyr_module.py --twister-out module_tests.args
242242
if [ -s module_tests.args ]; then
243243
./scripts/twister +module_tests.args --outdir module_tests ${TWISTER_COMMON} ${PUSH_OPTIONS}
@@ -323,34 +323,11 @@ jobs:
323323
if: success() || failure()
324324

325325
steps:
326-
# Needed for elasticearch and upload script
327-
- if: github.event_name == 'push' || github.event_name == 'schedule'
328-
name: Checkout
329-
uses: actions/checkout@v4
330-
with:
331-
fetch-depth: 0
332-
persist-credentials: false
333-
334326
- name: Download Artifacts
335327
uses: actions/download-artifact@v4
336328
with:
337329
path: artifacts
338330

339-
- if: github.event_name == 'push' || github.event_name == 'schedule'
340-
name: Upload to elasticsearch
341-
run: |
342-
pip3 install elasticsearch
343-
# set run date on upload to get consistent and unified data across the matrix.
344-
if [ "${{github.event_name}}" = "push" ]; then
345-
python3 ./scripts/ci/upload_test_results_es.py -r ${{needs.twister-build.outputs.rundate}} \
346-
--run-attempt ${{github.run_attempt}} \
347-
--index zephyr-main-ci-push-1 artifacts/*/*/twister.json
348-
elif [ "${{github.event_name}}" = "schedule" ]; then
349-
python3 ./scripts/ci/upload_test_results_es.py -r ${{needs.twister-build.outputs.rundate}} \
350-
--run-attempt ${{github.run_attempt}} \
351-
--index zephyr-main-ci-weekly-1 artifacts/*/*/twister.json
352-
fi
353-
354331
- name: Merge Test Results
355332
run: |
356333
pip3 install junitparser junit2html

0 commit comments

Comments
 (0)