]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
Merge all putty tests into a single test.
authorDarren Tucker <dtucker@dtucker.net>
Tue, 23 Sep 2025 12:12:19 +0000 (22:12 +1000)
committerDarren Tucker <dtucker@dtucker.net>
Thu, 25 Sep 2025 08:24:02 +0000 (18:24 +1000)
The lets us reuse the built OpenSSH binaries and replaces 12*4min of
tests with a single 14min one.

.github/install_putty.sh [new file with mode: 0755]
.github/run_test.sh
.github/setup_ci.sh
.github/workflows/c-cpp.yml

diff --git a/.github/install_putty.sh b/.github/install_putty.sh
new file mode 100755 (executable)
index 0000000..6d6d0ad
--- /dev/null
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+ver="$1"
+
+echo
+echo --------------------------------------
+echo Installing PuTTY version ${ver}
+echo --------------------------------------
+
+cd /tmp
+
+case "${ver}" in
+snapshot)
+       tarball=putty.tar.gz
+       url=https://tartarus.org/~simon/putty-snapshots/${tarball}
+       ;;
+*)
+       tarball=putty-${ver}.tar.gz
+       url=https://the.earth.li/~sgtatham/putty/${ver}/${tarball}
+       ;;
+esac
+
+if [ ! -f ${tarball} ]; then
+       wget -q ${url}
+fi
+
+mkdir -p /tmp/puttybuild
+cd /tmp/puttybuild
+
+tar xfz /tmp/${tarball} && cd putty-*
+if [ -f CMakeLists.txt ]; then
+       cmake . && cmake --build . -j4 && sudo cmake --build . --target install
+else
+       ./configure && make -j4 && sudo make install
+fi
+sudo rm -rf /tmp/puttybuild
+/usr/local/bin/plink -V
index bd6fb7b7b3e1087b6cc19ad517117d092b028215..aac9ce57942ee373dbee0e45c0e90a5f0cdfd8c8 100755 (executable)
@@ -35,6 +35,17 @@ if [ ! -z "${env}" ]; then
     env="env${env}"
 fi
 
+if [ "$1" = "putty-versions" ]; then
+       for ver in 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.80 \
+           0.81 0.82 0.83 snapshot; do
+               .github/install_putty.sh "${ver}"
+               ${env} make ${TEST_TARGET} \
+                   SKIP_LTESTS="${SKIP_LTESTS}" LTESTS="${LTESTS}"
+       done
+
+       exit 0
+fi
+
 if [ -z "${LTESTS}" ]; then
     ${env} make ${TEST_TARGET} SKIP_LTESTS="${SKIP_LTESTS}"
 else
index 10ff77badbef9c1e8ca3c7f424f25e5adf82a42b..c90969627022a2be34fc41bc382b339df481a80b 100755 (executable)
@@ -164,7 +164,7 @@ for TARGET in $TARGETS; do
         PACKAGES="${PACKAGES} cmake ninja-build"
         ;;
     putty-*)
-       INSTALL_PUTTY=$(echo "${TARGET}" | cut -f2 -d-)
+       INSTALL_PUTTY=0.83
        PACKAGES="${PACKAGES} cmake"
        ;;
     valgrind*)
@@ -273,25 +273,7 @@ if [ ! -z "${INSTALL_ZLIB}" ]; then
 fi
 
 if [ ! -z "${INSTALL_PUTTY}" ]; then
-    ver="${INSTALL_PUTTY}"
-    case "${INSTALL_PUTTY}" in
-    snapshot)
-       tarball=putty.tar.gz
-       (cd /tmp && wget https://tartarus.org/~simon/putty-snapshots/${tarball})
-       ;;
-    *)
-       tarball=putty-${ver}.tar.gz
-       (cd /tmp && wget https://the.earth.li/~sgtatham/putty/${ver}/${tarball})
-       ;;
-    esac
-    (cd ${HOME} && tar xfz /tmp/${tarball} && cd putty-*
-     if [ -f CMakeLists.txt ]; then
-       cmake . && cmake --build . && sudo cmake --build . --target install
-     else
-       ./configure && make && sudo make install
-     fi
-    )
-    /usr/local/bin/plink -V
+       .github/install_putty.sh "${INSTALL_PUTTY}"
 fi
 
 # If we're running on an ephemeral VM, set a random password and set
index 0ae83ccdb44b6769c18e4c5a200a035bf9228ef7..a479fd2f130ceb599fb797f6f931fde0742b52b9 100644 (file)
@@ -103,20 +103,7 @@ jobs:
           - { target: ubuntu-latest, config: openssl-3.4 }  # stable branch
           - { target: ubuntu-latest, config: openssl-3.5 }  # stable branch
           - { target: ubuntu-latest, config: openssl-3.6 }  # stable branch
-          - { target: ubuntu-latest, config: putty-0.71 }
-          - { target: ubuntu-latest, config: putty-0.72 }
-          - { target: ubuntu-latest, config: putty-0.73 }
-          - { target: ubuntu-latest, config: putty-0.74 }
-          - { target: ubuntu-latest, config: putty-0.75 }
-          - { target: ubuntu-latest, config: putty-0.76 }
-          - { target: ubuntu-latest, config: putty-0.77 }
-          - { target: ubuntu-latest, config: putty-0.78 }
-          - { target: ubuntu-latest, config: putty-0.79 }
-          - { target: ubuntu-latest, config: putty-0.80 }
-          - { target: ubuntu-latest, config: putty-0.81 }
-          - { target: ubuntu-latest, config: putty-0.82 }
-          - { target: ubuntu-latest, config: putty-0.83 }
-          - { target: ubuntu-latest, config: putty-snapshot }
+          - { target: ubuntu-latest, config: putty-versions }
           - { target: ubuntu-latest, config: zlib-develop }
           - { target: ubuntu-latest, config: tcmalloc }
           - { target: ubuntu-latest, config: musl }