Hello,

let us unify VTest installation magic.

Ilya
From 9f85fe25ad9ee6bf753311a44a5089a6ee2096c9 Mon Sep 17 00:00:00 2001
From: Ilya Shipitsin <[email protected]>
Date: Fri, 14 May 2021 23:59:35 +0500
Subject: [PATCH] CI: introduce scripts/build-vtest.sh for installing VTest

we install VTest for all CI systems, let us unify instalation
---
 .cirrus.yml                                | 3 +--
 .github/workflows/openssl-nodeprecated.yml | 3 +--
 .github/workflows/vtest.yml                | 8 ++------
 .travis.yml                                | 4 +---
 scripts/build-vtest.sh                     | 8 ++++++++
 5 files changed, 13 insertions(+), 13 deletions(-)
 create mode 100755 scripts/build-vtest.sh

diff --git a/.cirrus.yml b/.cirrus.yml
index fdabfdcdd..9b83e6169 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -6,8 +6,7 @@ FreeBSD_task:
   install_script:
     - pkg update -f && pkg upgrade -y && pkg install -y openssl git gmake lua53 socat pcre
   script:
-    - git clone https://github.com/VTest/VTest.git ../vtest
-    - make -C ../vtest
+    - scripts/build-vtest.sh
     - gmake CC=clang V=1 ERR=1 TARGET=freebsd USE_ZLIB=1 USE_PCRE=1 USE_OPENSSL=1 USE_LUA=1 LUA_INC=/usr/local/include/lua53 LUA_LIB=/usr/local/lib LUA_LIB_NAME=lua-5.3
     - ./haproxy -vv
     - ldd haproxy
diff --git a/.github/workflows/openssl-nodeprecated.yml b/.github/workflows/openssl-nodeprecated.yml
index b853fe233..6833911e4 100644
--- a/.github/workflows/openssl-nodeprecated.yml
+++ b/.github/workflows/openssl-nodeprecated.yml
@@ -23,8 +23,7 @@ jobs:
     - uses: actions/checkout@v1
     - name: prepare VTest
       run: |
-        git clone https://github.com/VTest/VTest.git ../vtest
-        make -C ../vtest FLAGS="-O2 -s -Wall"
+        scripts/build-vtest.sh
     - name: build haproxy
       run: |
         make DEFINE="-DOPENSSL_API_COMPAT=0x10100000L -DOPENSSL_NO_DEPRECATED" -j3 CC=gcc ERR=1 TARGET=linux-glibc USE_OPENSSL=1
diff --git a/.github/workflows/vtest.yml b/.github/workflows/vtest.yml
index cb52f27d6..f7f34d720 100644
--- a/.github/workflows/vtest.yml
+++ b/.github/workflows/vtest.yml
@@ -60,11 +60,7 @@ jobs:
         brew install lua
     - name: Install VTest
       run: |
-        curl -fsSL https://github.com/vtest/VTest/archive/master.tar.gz -o VTest.tar.gz
-        mkdir VTest
-        tar xvf VTest.tar.gz -C VTest --strip-components=1
-        make -C VTest -j$(nproc) FLAGS="-O2 -s -Wall"
-        sudo install -m755 VTest/vtest /usr/local/bin/vtest
+        scripts/build-vtest.sh
     - name: Install SSL ${{ matrix.ssl }}
       if: ${{ matrix.ssl && matrix.ssl != 'stock' }}
       run: env ${{ matrix.ssl }} scripts/build-ssl.sh
@@ -101,7 +97,7 @@ jobs:
     - name: Run VTest for HAProxy ${{ steps.show-version.outputs.version }}
       id: vtest
       # sudo is required, because macOS fails due to an open files limit.
-      run: sudo make reg-tests REGTESTS_TYPES=default,bug,devel
+      run: sudo make reg-tests VTEST_PROGRAM=../vtest/vtest REGTESTS_TYPES=default,bug,devel
     - name: Show results
       if: ${{ failure() }}
       # The chmod / sudo is necessary due to the `sudo` while running the tests.
diff --git a/.travis.yml b/.travis.yml
index 1aa415aa8..3083e302c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -38,9 +38,7 @@ matrix:
     if: type == cron
 
 install:
-  - git clone https://github.com/VTest/VTest.git ../vtest
-  # Special flags due to: https://github.com/vtest/VTest/issues/12
-  - make -C ../vtest FLAGS="-O2 -s -Wall"
+  - scripts/build-vtest.sh
 
 script:
   - make -j$(nproc) ERR=1 TARGET=linux-glibc CC=$CC DEBUG=-DDEBUG_STRICT=1 $FLAGS
diff --git a/scripts/build-vtest.sh b/scripts/build-vtest.sh
new file mode 100755
index 000000000..6a974951e
--- /dev/null
+++ b/scripts/build-vtest.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+set -eux
+
+git clone https://github.com/VTest/VTest.git ../vtest
+# Special flags due to: https://github.com/vtest/VTest/issues/12
+make -C ../vtest FLAGS="-O2 -s -Wall"
+
-- 
2.31.1

Reply via email to