[PATCH 11/14] ci: pytest: upload artifacts

Ahmad Fatoum a.fatoum at pengutronix.de
Sun Jun 4 23:36:20 PDT 2023


pytest can output junit XML files and labgrid writes a console_main file
with serial output. Let's collect both as artifacts of the build to make
it easier to debug issues.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 .github/workflows/test-labgrid-pytest.yml | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/test-labgrid-pytest.yml b/.github/workflows/test-labgrid-pytest.yml
index ae49decbaeae..6647237284d9 100644
--- a/.github/workflows/test-labgrid-pytest.yml
+++ b/.github/workflows/test-labgrid-pytest.yml
@@ -60,6 +60,22 @@ jobs:
         export KBUILD_OUTPUT=build-${{matrix.arch}}
 
         for i in ${{matrix.lgenv}}; do
-          echo "Testing $i"
-          labgrid-pytest --lg-env $i test/py --verbosity=1 --lg-log
+          cfg=$(basename $i .yaml)
+          echo "Testing $cfg"
+          labgrid-pytest --lg-env $i test/py --verbosity=1 \
+          --junitxml=$cfg.tests.xml --lg-log=log/$cfg
         done
+
+    - name: Publish Test Results
+      uses: EnricoMi/publish-unit-test-result-action at v2
+      if: always()
+      with:
+        files: ./*.tests.xml
+
+    - name: Publish Labgrid Log Results
+      uses: actions/upload-artifact at v3
+      if: always()
+      with:
+        name: Console Logs
+        path: log/
+        if-no-files-found: error
-- 
2.39.2




More information about the barebox mailing list