]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CI: VTest build with git clone + cache
authorWilliam Lallemand <wlallemand@haproxy.com>
Tue, 7 Apr 2026 16:05:14 +0000 (18:05 +0200)
committerWilliam Lallemand <wlallemand@haproxy.com>
Tue, 7 Apr 2026 16:35:23 +0000 (18:35 +0200)
The VTest2 tarball URL at code.vinyl-cache.org/vtest/VTest2/archive/main.tar.gz
no longer works. Switch scripts/build-vtest.sh to use a git clone of the
repository instead.

Add a cache step in the setup-vtest CI action so VTest is only rebuilt
when its HEAD commit changes, keyed on the runner OS and the VTest2 HEAD
SHA.

.github/actions/setup-vtest/action.yml
scripts/build-vtest.sh

index 0d9d85e241bd35034b416d71b388bec5eba19f24..c39c33207485b6eeaafe73d2b6797b852bed7634 100644 (file)
@@ -20,7 +20,21 @@ runs:
         ulimit -n 65536
         ulimit -c unlimited
 
+    - name: Get VTest latest commit SHA
+      id: vtest-sha
+      shell: bash
+      run: |
+        echo "sha=$(git ls-remote https://code.vinyl-cache.org/vtest/VTest2 HEAD | cut -f1)" >> $GITHUB_OUTPUT
+
+    - name: Cache VTest
+      id: cache-vtest
+      uses: actions/cache@v4
+      with:
+        path: ${{ github.workspace }}/../vtest
+        key: vtest-${{ runner.os }}-${{ steps.vtest-sha.outputs.sha }}
+
     - name: Install VTest
+      if: steps.cache-vtest.outputs.cache-hit != 'true'
       shell: bash
       run: |
         scripts/build-vtest.sh
index 9fc0c89ed62a49ac839b88dcb43db414aeb84d73..18ac428031a0e1df195d6c947dfc8ff048df42e4 100755 (executable)
@@ -4,9 +4,7 @@ DESTDIR=${DESTDIR:-${PWD}/../vtest/}
 TMPDIR=${TMPDIR:-$(mktemp -d)}
 set -eux
 
-curl -fsSL "https://code.vinyl-cache.org/vtest/VTest2/archive/main.tar.gz" -o "${TMPDIR}/VTest.tar.gz"
-mkdir -p "${TMPDIR}/vtest"
-tar xvf ${TMPDIR}/VTest.tar.gz -C "${TMPDIR}/vtest" --strip-components=1
+git clone https://code.vinyl-cache.org/vtest/VTest2 "${TMPDIR}/vtest"
 # Special flags due to: https://github.com/vtest/VTest/issues/12
 
 # Note: do not use "make -C ../vtest", otherwise MAKEFLAGS contains "w"