Skip to content

Commit 70a4975

Browse files
committed
publish es
Signed-off-by: Anas Nashif <[email protected]>
1 parent 45ede90 commit 70a4975

File tree

2 files changed

+52
-24
lines changed

2 files changed

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

.github/workflows/twister.yaml

Lines changed: 1 addition & 24 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: 5
3535
DAILY_MATRIX_SIZE: 80
3636
BSIM_OUT_PATH: /opt/bsim/
3737
BSIM_COMPONENTS_PATH: /opt/bsim/components
@@ -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)