bye bye Travis
authorgggeek <giunta.gaetano@gmail.com>
Tue, 7 Dec 2021 17:06:24 +0000 (17:06 +0000)
committergggeek <giunta.gaetano@gmail.com>
Tue, 7 Dec 2021 17:06:24 +0000 (17:06 +0000)
.gitattributes
.github/workflows/ci.yml
.travis.yml [deleted file]
doc/manual/phpxmlrpc_manual.adoc
tests/ci/setup/setup_apache.sh
tests/ci/setup/setup_code_coverage.sh
tests/ci/setup/setup_php.sh
tests/ci/setup/setup_php_travis.sh [deleted file]
tests/ci/vm.sh

index be12dd5..5b0bb2d 100644 (file)
@@ -9,6 +9,5 @@ tests/ export-ignore
 .editorconfig export-ignore
 .gitattributes export-ignore
 .gitignore export-ignore
-.travis.yml export-ignore
 pakefile.php export-ignore
 phpunit.xml.dist export-ignore
index 18f6bf2..d4d2fc9 100644 (file)
@@ -11,9 +11,9 @@ jobs:
             HTTPSSERVER: localhost
             HTTPSURI: /demo/server/server.php
             PROXYSERVER: localhost:8080
-            # Travis currently compiles PHP with an oldish cURL/GnuTLS combination;
-            # to make the tests pass when Apache has a bogus SSL cert whe need the full set of options below.
             # @todo check: is this necessary as well on GHA runners?
+            # was: Travis currently compiles PHP with an oldish cURL/GnuTLS combination;
+            # to make the tests pass when Apache has a bogus SSL cert whe need the full set of options below.
             HTTPSVERIFYHOST: 0
             HTTPSIGNOREPEER: 1
             SSLVERSION: 0
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644 (file)
index 378e3b2..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-language: php
-
-# As of May 2019, Travis is deprecating VMs based on Precise, which means that we can only test on php >= 5.6 going forward
-# (nb: this is not necessarily true yet - and we can use a different base for each php version, but we'll have to
-# adapt composer.json plus the apache / env setup scripts to accommodate that...)
-dist: xenial
-
-env:
-    global:
-        - HTTPSERVER=localhost
-        - URI=/demo/server/server.php
-        - HTTPSSERVER=localhost
-        - HTTPSURI=/demo/server/server.php
-        - PROXYSERVER=localhost:8080
-        # Travis currently compiles PHP with an oldish cURL/GnuTLS combination;
-        # to make the tests pass when Apache has a bogus SSL cert whe need the full set of options below
-        - HTTPSVERIFYHOST=0
-        - HTTPSIGNOREPEER=1
-        - SSLVERSION=0
-        - DEBUG=0
-
-php:
-  #- 5.3
-  #- 5.4
-  #- 5.5
-  - 5.6
-  - 7.0
-  - 7.1
-  - 7.2
-  - 7.3
-  - 7.4
-  - 8.0
-
-before_install:
-  # @todo stop useless daemons to save memory: snapd, dockerd, ...
-  # This is mandatory or the 'apt-get install' calls following will fail
-  - sudo apt-get update -qq
-  # Just in case there are git misconfigurations: make sure scripts are executable
-  - sudo chmod 755 ./tests/ci/setup/*.sh
-  - sudo ./tests/ci/setup/setup_perl.sh
-  - sudo ./tests/ci/setup/setup_apache.sh
-  - sudo ./tests/ci/setup/setup_privoxy.sh
-  - ./tests/ci/setup/setup_php_travis.sh
-
-install:
-  - composer install
-
-before_script:
-  # Output what version of phpunit we got going
-  #- ./vendor/bin/phpunit --version
-  # Enable code coverage for a single version of php
-  - if [ "$TRAVIS_PHP_VERSION" = "7.4" ]; then ./tests/ci/setup/setup_code_coverage.sh enable && export PHPUNIT_OPTS="--coverage-clover=coverage.clover"; fi
-
-script:
-    - ./vendor/bin/phpunit -v $PHPUNIT_OPTS tests
-    - python3 demo/client/python/test.py
-    - perl demo/client/perl/test.pl
-
-after_failure:
-  # Troubleshoot test env build problems
-  #- ps auxwww
-  #- 'sudo find /etc/php | sed -e "s/[^-][^\/]*\// |/g" -e "s/|\([^ ]\)/|-\1/"'
-  #- php -i
-  #- ls -la /run/php
-  #- ls -ltr /var/log
-  #- sudo ls -ltr /var/log/apache2
-  #- 'sudo find /etc/apache2 | sed -e "s/[^-][^\/]*\// |/g" -e "s/|\([^ ]\)/|-\1/"'
-
-  # Show as much info as we can to help developers
-  - sudo cat /var/log/privoxy/*
-  - sudo cat /var/log/apache2/error.log
-  - sudo cat /var/log/apache2/other_vhosts_access.log
-  - sudo cat /var/log/php*.log
-
-after_script:
-  # Upload code-coverage to Scrutinizer
-  - if [ -f coverage.clover ]; then wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi
-  # Upload code-coverage CodeClimate - disabled as it does not support php 8 atm
-  #- if [ -f coverage.clover ]; then CODECLIMATE_REPO_TOKEN=7fa6ee01e345090e059e5e42f3bfbcc8692feb8340396382dd76390a3019ac13 ./vendor/bin/test-reporter --coverage-report=coverage.clover; fi
-
-# reduce depth (history) of git checkout
-git:
-    depth: 1
index 97f5ccd..f945537 100644 (file)
@@ -139,7 +139,7 @@ lib/*:: a compatibility layer for applications which still rely on version 3 of
 
 src/*:: the XML-RPC library classes. You can autoload these via Composer, or via a dedicated Autoloader class
 
-tests/*:: the test suite for the library, written using PhpUnit, and the configuration to run it on Travis
+tests/*:: the test suite for the library, written using PhpUnit, and the configuration to run it either on GitHub Actions or in a local Docker container
 
 
 [[bugs]]
@@ -1953,7 +1953,7 @@ Backward compatibility is maintained via _lib/xmlrpc.inc_, _lib/xmlrpcs.inc_ and
 
 * improved: a specific option allows users to decide the version of SSL to use for https calls.
   This is useful f.e. for the testing suite, when the server target of calls has no proper ssl certificate,
-  and the cURL extension has been compiled with GnuTLS (such as on Travis VMs)
+  and the cURL extension has been compiled with GnuTLS
 
 * improved: the function `wrap_php_function()` now can be used to wrap closures (it is now a method btw)
 
index 0fb7f4e..b29cde2 100755 (executable)
@@ -11,7 +11,6 @@ SCRIPT_DIR="$(dirname -- "$(readlink -f "$0")")"
 DEBIAN_FRONTEND=noninteractive apt-get install -y apache2
 
 # set up Apache for php-fpm
-# @see https://github.com/travis-ci/travis-ci.github.com/blob/master/docs/user/languages/php.md#apache--php
 
 a2enmod rewrite proxy_fcgi setenvif ssl
 
@@ -28,7 +27,7 @@ if [ -f /etc/apache2/sites-available/default-ssl.conf ]; then
     rm /etc/apache2/sites-available/default-ssl.conf
 fi
 
-if [ -n "${TRAVIS}" -o -n "${GITHUB_ACTIONS}" ]; then
+if [ -n "${GITHUB_ACTIONS}" ]; then
     echo "export TESTS_ROOT_DIR=$(pwd)" >> /etc/apache2/envvars
 else
     echo "export TESTS_ROOT_DIR=/var/www/html" >> /etc/apache2/envvars
index 145de3d..11309a6 100755 (executable)
@@ -3,44 +3,25 @@
 # @todo add 'query' action
 # @todo avoid reloading php-fpm if config did not change
 
-# Note: we have php set up either via phpenv (TRAVIS=true), Ubuntu packages (PHP_VERSION=default) or Sury packages.
+# Note: we have php set up either via Ubuntu packages (PHP_VERSION=default) or Sury packages.
 #       xdebug comes either at version 2 or 3
 
 set -e
 
-if [ "$TRAVIS" != true ]; then
-    PHPCONFDIR_CLI=$(php -i | grep 'Scan this dir for additional .ini files' | sed 's|Scan this dir for additional .ini files => ||')
-    PHPCONFDIR_FPM=$(echo "$PHPCONFDIR_CLI" | sed 's|/cli/|/fpm/|')
-fi
-
 enable_cc() {
-    if [ "$TRAVIS" = true ]; then
-        phpenv config-add tests/ci/config/codecoverage_xdebug.ini
-
-        pkill php-fpm
-        ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm
-    else
-        if [ -L "${PHPCONFDIR_CLI}/99-codecoverage_xdebug.ini" ]; then sudo rm "${PHPCONFDIR_CLI}/99-codecoverage_xdebug.ini"; fi
-        sudo ln -s $(realpath tests/ci/config/codecoverage_xdebug.ini) "${PHPCONFDIR_CLI}/99-codecoverage_xdebug.ini"
-        if [ -L "${PHPCONFDIR_FPM}/99-codecoverage_xdebug.ini" ]; then sudo rm "${PHPCONFDIR_FPM}/99-codecoverage_xdebug.ini"; fi
-        sudo ln -s $(realpath tests/ci/config/codecoverage_xdebug.ini) "${PHPCONFDIR_FPM}/99-codecoverage_xdebug.ini"
-
-        sudo service php-fpm restart
-    fi
+    if [ -L "${PHPCONFDIR_CLI}/99-codecoverage_xdebug.ini" ]; then sudo rm "${PHPCONFDIR_CLI}/99-codecoverage_xdebug.ini"; fi
+    sudo ln -s $(realpath tests/ci/config/codecoverage_xdebug.ini) "${PHPCONFDIR_CLI}/99-codecoverage_xdebug.ini"
+    if [ -L "${PHPCONFDIR_FPM}/99-codecoverage_xdebug.ini" ]; then sudo rm "${PHPCONFDIR_FPM}/99-codecoverage_xdebug.ini"; fi
+    sudo ln -s $(realpath tests/ci/config/codecoverage_xdebug.ini) "${PHPCONFDIR_FPM}/99-codecoverage_xdebug.ini"
+
+    sudo service php-fpm restart
 }
 
 disable_cc() {
-    if [ "$TRAVIS" = true ]; then
-        phpenv config-rm tests/ci/config/codecoverage_xdebug.ini
-
-        pkill php-fpm
-        ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm
-    else
-        if [ -L "${PHPCONFDIR_CLI}/99-codecoverage_xdebug.ini" ]; then sudo rm "${PHPCONFDIR_CLI}/99-codecoverage_xdebug.ini"; fi
-        if [ -L "${PHPCONFDIR_FPM}/99-codecoverage_xdebug.ini" ]; then sudo rm "${PHPCONFDIR_FPM}/99-codecoverage_xdebug.ini"; fi
+    if [ -L "${PHPCONFDIR_CLI}/99-codecoverage_xdebug.ini" ]; then sudo rm "${PHPCONFDIR_CLI}/99-codecoverage_xdebug.ini"; fi
+    if [ -L "${PHPCONFDIR_FPM}/99-codecoverage_xdebug.ini" ]; then sudo rm "${PHPCONFDIR_FPM}/99-codecoverage_xdebug.ini"; fi
 
-        sudo service php-fpm restart
-    fi
+    sudo service php-fpm restart
 }
 
 case "$1" in
index 342404d..03bf0be 100755 (executable)
@@ -2,8 +2,6 @@
 
 # Has to be run as admin
 
-# To be kept in sync with setup_php_travis.sh
-
 # @todo make it optional to install xdebug. It is fe. missing in sury's ppa for Xenial
 # @todo make it optional to disable xdebug ?
 
diff --git a/tests/ci/setup/setup_php_travis.sh b/tests/ci/setup/setup_php_travis.sh
deleted file mode 100755 (executable)
index 4cc194e..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/bin/sh
-
-# To be kept in sync with setup_php.sh
-
-# @todo make it optional to disable xdebug ?
-
-set -e
-
-SCRIPT_DIR="$(dirname -- "$(readlink -f "$0")")"
-
-configure_php_ini() {
-    echo "cgi.fix_pathinfo = 1" >> "${1}"
-    echo "always_populate_raw_post_data = -1" >> "${1}"
-
-    # we disable xdebug for speed for both cli and web mode
-    phpenv config-rm xdebug.ini
-}
-
-PHPVER=$(phpenv version-name)
-
-configure_php_ini ~/.phpenv/versions/${PHPVER}/etc/php.ini
-
-# configure php-fpm
-cp ~/.phpenv/versions/${PHPVER}/etc/php-fpm.conf.default ~/.phpenv/versions/${PHPVER}/etc/php-fpm.conf
-
-# work around travis issue #3385
-if [ -d ~/.phpenv/versions/${PHPVER}/etc/php-fpm.d ]; then
-    # it seems that www.conf does not exist for php 7.0 .. 7.3
-    if [ -f ~/.phpenv/versions/${PHPVER}/etc/php-fpm.d/www.conf.default -a ! -f ~/.phpenv/versions/${PHPVER}/etc/php-fpm.d/www.conf ]; then
-        cp ~/.phpenv/versions/${PHPVER}/etc/php-fpm.d/www.conf.default ~/.phpenv/versions/${PHPVER}/etc/php-fpm.d/www.conf
-    fi
-fi
-
-# Use a unix socket for communication between apache and php-fpm - same as Ubuntu does by default
-if [ -f ~/.phpenv/versions/${PHPVER}/etc/php-fpm.d/www.conf ]; then
-    sed -i -e "s,listen = 127.0.0.1:9000,listen = /run/php/php-fpm.sock,g" ~/.phpenv/versions/${PHPVER}/etc/php-fpm.d/www.conf
-else
-    # php 5.6 has all fpm conf in a single file
-    sed -i -e "s,listen = 127.0.0.1:9000,listen = /run/php/php-fpm.sock,g" ~/.phpenv/versions/${PHPVER}/etc/php-fpm.conf
-    sed -i -e "s,user = nobody,user = travis,g" ~/.phpenv/versions/${PHPVER}/etc/php-fpm.conf
-    sed -i -e "s,group = nobody,group = travis,g" ~/.phpenv/versions/${PHPVER}/etc/php-fpm.conf
-fi
-sudo mkdir /run/php
-sudo chown travis:travis /run/php
-
-# @todo run php-fpm as root, and (always) set up 'travis' as user in www.conf, instead ?
-~/.phpenv/versions/${PHPVER}/sbin/php-fpm
-
-# configure apache for php-fpm via mod_proxy_fcgi
-sudo cp -f "$SCRIPT_DIR/../config/apache_phpfpm_proxyfcgi" "/etc/apache2/conf-available/php${PHPVER}-fpm.conf"
-sudo a2enconf php${PHPVER}-fpm
-sudo sed -i -e "s,www-data,travis,g" /etc/apache2/envvars
-sudo service apache2 restart
index a44c825..1cef916 100755 (executable)
@@ -9,7 +9,6 @@ ACTION="${1}"
 # Valid values: 'default', 5.6, 7.0 .. 7.4, 8.0 .. 8.1
 export PHP_VERSION=${PHP_VERSION:-default}
 # Valid values: precise (12), trusty (14), xenial (16), bionic (18), focal (20)
-# We default to the same version we use on Travis
 export UBUNTU_VERSION=${UBUNTU_VERSION:-bionic}
 
 CONTAINER_USER=docker