From a75a9f29d8287cb04c0c1e11cc7848f2d7ebc075 Mon Sep 17 00:00:00 2001 From: Roman Zeyde Date: Thu, 30 Jan 2025 09:26:02 +0200 Subject: [PATCH] ci: fix JSONDecodeError when combining `.coverage.gw*` files For example: https://github.com/trezor/trezor-firmware/actions/runs/12976369614/job/36188913357 Single `.coverage` files were renamed, but `make test_emu_ui_multicore` generates multiple `.coverage.gw*` files, which may overwrite each other in case there are multiple similar CI jobs (e.g. when translation-related jobs are enabled). [no changelog] --- .github/actions/upload-coverage/action.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/actions/upload-coverage/action.yml b/.github/actions/upload-coverage/action.yml index 6e240df22a..5492fc33be 100644 --- a/.github/actions/upload-coverage/action.yml +++ b/.github/actions/upload-coverage/action.yml @@ -2,7 +2,12 @@ name: 'Upload coverage data' runs: using: "composite" steps: - - run: mv core/src/.coverage core/src/.coverage.${{ github.job }}${{ strategy.job-index }} || true + # add per-job suffix so the .coverage files won't be overwritten during merge (by `core_coverage_report`) + - run: | + for F in core/src/.coverage core/src/.coverage.gw* + do + mv -v $F $F.${{ github.job }}${{ strategy.job-index }} || true + done shell: sh - uses: actions/upload-artifact@v4 with: