[PATCH] ci: pytest: don't attempt uploading test logs if build fails

Ahmad Fatoum a.fatoum at pengutronix.de
Tue May 27 13:13:14 PDT 2025


If the build failed, no tests can be run and no artifacts from the
test tun will be created. We still want to upload any test logs we have
if the tests themselves failed, therefore replace always() with an
explicit check for the build step to have succeeded.

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

diff --git a/.github/workflows/test-labgrid-pytest.yml b/.github/workflows/test-labgrid-pytest.yml
index 315868779bee..d4043de961b2 100644
--- a/.github/workflows/test-labgrid-pytest.yml
+++ b/.github/workflows/test-labgrid-pytest.yml
@@ -64,6 +64,7 @@ jobs:
       uses: actions/checkout at v4
 
     - name: Build
+      id: build
       run: |
         export KBUILD_OUTPUT=build-${{matrix.arch}}-${{matrix.defconfig}}
         export ARCH=${{matrix.arch}}
@@ -94,14 +95,14 @@ jobs:
 
     - name: Publish Test Results
       uses: EnricoMi/publish-unit-test-result-action at v2
-      if: always()
+      if: steps.build.outcome == 'success'
       with:
         check_name: "Test Results (${{matrix.defconfig}})"
         files: ./*.tests.xml
 
     - name: Publish Labgrid Log Results
       uses: actions/upload-artifact at v4
-      if: always()
+      if: steps.build.outcome == 'success'
       with:
         name: console-log-${{matrix.defconfig}}
         path: log/
-- 
2.39.5




More information about the barebox mailing list