Skip to content

Commit 82b440b

Browse files
committed
create db
Signed-off-by: Anas Nashif <[email protected]>
1 parent 027b89c commit 82b440b

File tree

1 file changed

+19
-69
lines changed

1 file changed

+19
-69
lines changed

.github/workflows/twister.yaml

Lines changed: 19 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ jobs:
143143
CCACHE_IGNOREOPTIONS: '-specs=* --specs=*'
144144
BSIM_OUT_PATH: /opt/bsim/
145145
BSIM_COMPONENTS_PATH: /opt/bsim/components
146-
TWISTER_COMMON: ' --test-config tests/test_config_ci.yaml --no-detailed-test-id --force-color --inline-logs -v -N -M --retry-failed 3 --timeout-multiplier 2 -j 16'
146+
TWISTER_COMMON: ' --test-config tests/test_config_ci.yaml --no-detailed-test-id --force-color --inline-logs -v -N -M --retry-failed 3 --timeout-multiplier 2 -j 16 --cmake-only'
147147
WEEKLY_OPTIONS: ' -M --build-only --all --show-footprint --report-filtered'
148148
PR_OPTIONS: ' --clobber-output --integration'
149149
PUSH_OPTIONS: ' --clobber-output -M --show-footprint --report-filtered'
@@ -265,29 +265,21 @@ jobs:
265265
export ZEPHYR_BASE=${PWD}
266266
export ZEPHYR_TOOLCHAIN_VARIANT=zephyr
267267
./scripts/twister --subset ${{matrix.subset}}/${{ strategy.job-total }} ${TWISTER_COMMON} ${WEEKLY_OPTIONS}
268-
if [ "${{matrix.subset}}" = "1" ]; then
269-
./scripts/zephyr_module.py --twister-out module_tests.args
270-
if [ -s module_tests.args ]; then
271-
./scripts/twister +module_tests.args --outdir module_tests ${TWISTER_COMMON} ${WEEKLY_OPTIONS}
272-
fi
273-
fi
268+
python ./scripts/ci/db/gen_test_database.py --directory twister-out/ --output db_${{matrix.subset}}.json
274269
275270
- name: Print ccache stats
276271
if: always()
277272
run: |
278273
ccache -s -vv
279274
280-
- name: Upload Unit Test Results
275+
- name: Upload Database
281276
if: always()
282-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
277+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
283278
with:
284-
name: Unit Test Results (Subset ${{ matrix.subset }})
279+
name: Test and Source DB (Subset ${{ matrix.subset }})
285280
if-no-files-found: ignore
286281
path: |
287-
twister-out/twister.xml
288-
twister-out/twister.json
289-
module_tests/twister.xml
290-
testplan.json
282+
db_${{matrix.subset}}.json
291283
292284
- if: matrix.subset == 1 && github.event_name == 'push'
293285
name: Save the list of Python packages
@@ -306,80 +298,38 @@ jobs:
306298
name: Frozen PIP package set
307299
path: |
308300
frozen-requirements.txt
309-
310-
twister-test-results:
311-
name: "Publish Unit Tests Results"
301+
test-db-results:
302+
name: "Publish Merged DB"
312303
needs:
313-
- twister-build
304+
- test-source-db
314305
runs-on: ubuntu-22.04
315306
permissions:
316307
checks: write # to create the check run entry with Twister test results
317308
# the build-and-test job might be skipped, we don't need to run this job then
318309
if: success() || failure()
319310

320311
steps:
321-
- name: Check out source code
322-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
323-
with:
324-
ref: ${{ github.event.pull_request.head.sha }}
325-
fetch-depth: 0
326-
persist-credentials: false
327-
328-
- name: Set up Python
329-
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
330-
with:
331-
python-version: 3.12
332-
cache: pip
333-
cache-dependency-path: scripts/requirements-actions.txt
334-
335-
- name: Install Python packages
312+
- name: Install packages
336313
run: |
337-
pip install -r scripts/requirements-actions.txt --require-hashes
338-
314+
sudo apt-get update -y
315+
sudo apt install -y jq
339316
- name: Download Artifacts
340-
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
317+
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
341318
with:
342319
path: artifacts
343320

344-
- name: Merge Test Results
321+
- name: Merge DB files
345322
run: |
346-
junitparser merge artifacts/*/*/twister.xml junit.xml
347-
junit2html junit.xml junit.html
348-
349-
- name: Upload Unit Test Results
323+
jq -s '.' artifacts/*/*.json > db.json
324+
- name: Upload Merged DB
350325
if: always()
351-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
326+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
352327
with:
353-
name: Unit Test Results
328+
name: Merged DB
354329
if-no-files-found: ignore
355330
path: |
356-
junit.html
357-
junit.xml
358-
359-
- name: Publish Unit Test Results
360-
uses: EnricoMi/publish-unit-test-result-action@170bf24d20d201b842d7a52403b73ed297e6645b # v2.18.0
361-
with:
362-
check_name: Unit Test Results
363-
files: "**/twister.xml"
364-
comment_mode: off
365-
366-
- name: Analyze Twister Reports
367-
if: needs.twister-build.result == 'failure'
368-
run: |
369-
./scripts/ci/twister_report_analyzer.py artifacts/*/*/twister.json --long-summary --platforms --output-md errors.md
370-
if [[ -s "errors.md" ]]; then
371-
echo '### Error Summary! 🚀' >> $GITHUB_STEP_SUMMARY
372-
cat errors.md >> $GITHUB_STEP_SUMMARY
373-
fi
331+
db.json
374332
375-
- name: Upload Twister Analysis Results
376-
if: needs.twister-build.result == 'failure'
377-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
378-
with:
379-
name: Twister Analysis Results
380-
if-no-files-found: ignore
381-
path: |
382-
twister_report_summary.json
383333
384334
twister-status-check:
385335
if: always()

0 commit comments

Comments
 (0)