]> git.kaiwu.me - haproxy.git/commitdiff
CI: github: fix VTest cache paths in container jobs
authorWilliam Lallemand <wlallemand@haproxy.com>
Mon, 19 Oct 2026 12:26:13 +0000 (12:26 +0000)
committerWilliam Lallemand <wlallemand@haproxy.com>
Mon, 19 Oct 2026 14:08:06 +0000 (16:08 +0200)
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.

.github/actions/setup-vtest/action.yml
.github/workflows/fedora-rawhide.yml
.github/workflows/openssl-master.yml
.github/workflows/quictls.yml
.github/workflows/vtest.yml
.github/workflows/wolfssl.yml

index c6071b47356ce97d5f612e6277dd4b7db916b4a8..e2857296c5a1b00693b2c64029648bf9366459d1 100644 (file)
@@ -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
index 5e4029368cd2e547c42c167fd04dfbbfb8c491ec..df0774fc68838d7d13761bda54842c3dda5ddb99 100644 (file)
@@ -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: |
index 054f8c1baded5aeed92b94f1bff26860547d72bf..7eb004e7749171ca30c4943f20ef87c6f2a3868b 100644 (file)
@@ -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: |
index dfb2d67423e291e7cdc054515ffa68529c440fe4..245c1979e8a64d29bf9340744258f66815fea169 100644 (file)
@@ -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: |
index f1af2d8e1ee70614c99f7f8a18a99ef772e15960..713e2abcd47a39a20e9e1d706ac8296445271883 100644 (file)
@@ -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: |
index ffb7bb61441e8499216dc55602170d8870fd1e55..9e7ca3367a982fe413c6513c068938def6d4a5e9 100644 (file)
@@ -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: |