From: William Lallemand Date: Mon, 19 Oct 2026 12:26:13 +0000 (+0000) Subject: CI: github: fix VTest cache paths in container jobs X-Git-Tag: v3.5-dev10~124 X-Git-Url: https://git.kaiwu.me/?a=commitdiff_plain;h=d783bdb5c1198d10aa0d3c5b9f5fa8ad87847f78;p=haproxy.git CI: github: fix VTest cache paths in container jobs The Alpine job rebuilds VTest without publishing a cache entry. Its cache save receives the host workspace path, which does not exist inside the container, and reports a Path Validation Error. Changing only the cache path to "vtest" still leaves installation using the context path, so the cached directory remains empty. Install VTest under the runtime GITHUB_WORKSPACE and use the same location in all workflows that call setup-vtest. Keep restore and save paths workspace-relative so that the installed binary is found inside the container and cache hits restore it where the callers expect it. Split caching into explicit restore and save steps, saving immediately after installing VTest rather than relying on the post-job hook. Reuse the restore step's primary key. Include the distribution and version in the key to keep Alpine/musl binaries separate from glibc builds on runners with the same architecture. --- diff --git a/.github/actions/setup-vtest/action.yml b/.github/actions/setup-vtest/action.yml index c6071b473..e2857296c 100644 --- a/.github/actions/setup-vtest/action.yml +++ b/.github/actions/setup-vtest/action.yml @@ -21,24 +21,39 @@ runs: ulimit -n 65536 ulimit -c unlimited + - name: Get the build environment ID + id: env-id + shell: sh + run: | + environment_id=$( (. /etc/os-release 2>/dev/null && echo "${ID:-unknown}${VERSION_ID:+-${VERSION_ID}}") || uname -s ) + echo "id=${environment_id}" >> "$GITHUB_OUTPUT" + - name: Get VTest latest commit SHA id: vtest-sha shell: sh run: | echo "sha=$(git ls-remote https://code.vinyl-cache.org/vtest/VTest2 HEAD | cut -f1)" >> $GITHUB_OUTPUT - - name: Cache VTest + - name: Restore VTest cache id: cache-vtest - uses: actions/cache@v5 + uses: actions/cache/restore@v5 with: - path: ${{ github.workspace }}/vtest - key: vtest-${{ runner.os }}-${{ runner.arch }}-${{ steps.vtest-sha.outputs.sha }} + path: vtest + key: vtest-${{ runner.os }}-${{ runner.arch }}-${{ steps.env-id.outputs.id }}-${{ steps.vtest-sha.outputs.sha }} - name: Install VTest if: ${{ steps.cache-vtest.outputs.cache-hit != 'true' }} shell: sh run: | - DESTDIR=${{ github.workspace }}/vtest scripts/build-vtest.sh + # Use the runtime workspace, not the host-side github.workspace path. + DESTDIR="$GITHUB_WORKSPACE/vtest" scripts/build-vtest.sh + + - name: Save VTest cache + if: ${{ steps.cache-vtest.outputs.cache-hit != 'true' }} + uses: actions/cache/save@v5 + with: + path: vtest + key: ${{ steps.cache-vtest.outputs.cache-primary-key }} - name: Install problem matcher for VTest shell: sh diff --git a/.github/workflows/fedora-rawhide.yml b/.github/workflows/fedora-rawhide.yml index 5e4029368..df0774fc6 100644 --- a/.github/workflows/fedora-rawhide.yml +++ b/.github/workflows/fedora-rawhide.yml @@ -54,7 +54,7 @@ jobs: - name: Run VTest for HAProxy ${{ steps.show-version.outputs.version }} id: vtest run: | - make reg-tests VTEST_PROGRAM=${{ github.workspace }}/vtest/vtest REGTESTS_TYPES=default,bug,devel + make reg-tests VTEST_PROGRAM="$GITHUB_WORKSPACE/vtest/vtest" REGTESTS_TYPES=default,bug,devel - name: Show VTest results if: ${{ failure() && steps.vtest.outcome == 'failure' }} run: | diff --git a/.github/workflows/openssl-master.yml b/.github/workflows/openssl-master.yml index 054f8c1ba..7eb004e77 100644 --- a/.github/workflows/openssl-master.yml +++ b/.github/workflows/openssl-master.yml @@ -46,7 +46,7 @@ jobs: ulimit -n 65536 # allow to catch coredumps ulimit -c unlimited - make reg-tests VTEST_PROGRAM=${{ github.workspace }}/vtest/vtest REGTESTS_TYPES=default,bug,devel + make reg-tests VTEST_PROGRAM="$GITHUB_WORKSPACE/vtest/vtest" REGTESTS_TYPES=default,bug,devel - name: Show VTest results if: ${{ failure() && steps.vtest.outcome == 'failure' }} run: | diff --git a/.github/workflows/quictls.yml b/.github/workflows/quictls.yml index dfb2d6742..245c1979e 100644 --- a/.github/workflows/quictls.yml +++ b/.github/workflows/quictls.yml @@ -43,7 +43,7 @@ jobs: - name: Run VTest for HAProxy id: vtest run: | - make reg-tests VTEST_PROGRAM=${{ github.workspace }}/vtest/vtest REGTESTS_TYPES=default,bug,devel + make reg-tests VTEST_PROGRAM="$GITHUB_WORKSPACE/vtest/vtest" REGTESTS_TYPES=default,bug,devel - name: Show VTest results if: ${{ failure() && steps.vtest.outcome == 'failure' }} run: | diff --git a/.github/workflows/vtest.yml b/.github/workflows/vtest.yml index f1af2d8e1..713e2abcd 100644 --- a/.github/workflows/vtest.yml +++ b/.github/workflows/vtest.yml @@ -128,7 +128,7 @@ jobs: - name: Run VTest for HAProxy ${{ steps.show-version.outputs.version }} id: vtest run: | - make reg-tests VTEST_PROGRAM=${{ github.workspace }}/vtest/vtest REGTESTS_TYPES=default,bug,devel + make reg-tests VTEST_PROGRAM="$GITHUB_WORKSPACE/vtest/vtest" REGTESTS_TYPES=default,bug,devel - name: Show VTest results if: ${{ failure() && steps.vtest.outcome == 'failure' }} run: | diff --git a/.github/workflows/wolfssl.yml b/.github/workflows/wolfssl.yml index ffb7bb614..9e7ca3367 100644 --- a/.github/workflows/wolfssl.yml +++ b/.github/workflows/wolfssl.yml @@ -39,7 +39,7 @@ jobs: - name: Run VTest for HAProxy id: vtest run: | - make reg-tests VTEST_PROGRAM=${{ github.workspace }}/vtest/vtest REGTESTS_TYPES=default,bug,devel + make reg-tests VTEST_PROGRAM="$GITHUB_WORKSPACE/vtest/vtest" REGTESTS_TYPES=default,bug,devel - name: Run Unit tests id: unittests run: |