From e6bea0372b60f4b289f8b4d59b42b36e16bc2930 Mon Sep 17 00:00:00 2001 From: Ahmed Elaidy Date: Mon, 9 Mar 2026 15:33:31 +0200 Subject: [PATCH] ci: stabilize gcov-test coverage upload Two problems made gcov-test unreliable: 1. The gcov step ran with --max-procs 4, causing multiple gcov processes to concurrently read and update the same .gcda files. GCC does not protect these files against concurrent access, so this can silently corrupt coverage data or produce non-deterministic failures. Drop --max-procs to serialize gcov. 2. 'make codecov' curls the uploader binary from https://uploader.codecov.io/latest/linux/codecov at job runtime. This fails on Codecov CDN outages and on pull requests from forks where CODECOV_TOKEN is not forwarded. Replace this step with the pinned codecov/codecov-action@v5, which avoids the runtime curl and handles both authenticated and unauthenticated cases gracefully. Fixes: #2911 Signed-off-by: Ahmed Elaidy --- .github/workflows/ci.yml | 8 +++++--- scripts/ci/run-ci-tests.sh | 3 +++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index de70371bf..90fba585c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -139,9 +139,11 @@ jobs: - name: Run Coverage Tests run: sudo -E make -C scripts/ci local GCOV=1 - name: Run gcov - run: sudo -E find . -name '*gcda' -type f -print0 | sudo -E xargs --null --max-args 128 --max-procs 4 gcov - - name: Run Coverage Analysis - run: sudo -E make codecov + run: sudo -E find . -name '*gcda' -type f -print0 | sudo -E xargs --null --max-args 128 gcov + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} java-test: needs: [alpine-test] diff --git a/scripts/ci/run-ci-tests.sh b/scripts/ci/run-ci-tests.sh index 05a3b71e8..89a3f3384 100755 --- a/scripts/ci/run-ci-tests.sh +++ b/scripts/ci/run-ci-tests.sh @@ -195,6 +195,9 @@ fi # umask has to be called before a first criu run, so that .gcda (coverage data) # files are created with read-write permissions for all. umask 0000 +# Also fix permissions on .gcda files already created during the build (owned +# by root). Restored processes run as non-root and must be able to write them. +find . -name '*.gcda' -exec chmod a+rw {} + ./criu/criu check ./criu/criu check --all || echo $? if [ "$UNAME_M" == "x86_64" ]; then