Run tests on 32-bit systems on Travis CI

This commit is contained in:
Ben Ramsey
2019-12-03 17:27:54 -08:00
parent 242f83df0c
commit 671772fffe
5 changed files with 60 additions and 12 deletions
+19 -8
View File
@@ -1,6 +1,9 @@
language: php
os: linux
services:
- docker
jobs:
fast_finish: true
include:
@@ -16,12 +19,18 @@ jobs:
- php: 7.2
- php: 7.2
arch: s390x
- php: 7.2
env: ARCH=arm32
- php: 7.3
- php: 7.3
arch: s390x
- php: 7.3
env: ARCH=arm32
- php: 7.4
- php: 7.4
arch: s390x
- php: 7.4
env: ARCH=arm32
- php: nightly
- php: nightly
arch: s390x
@@ -36,21 +45,23 @@ addons:
- libsodium-dev
- uuid-dev
cache:
directories:
- $HOME/.composer
before_install:
- ./resources/scripts/system-info.sh
- yes '' | pecl install -f libsodium-1.0.7
- yes '' | pecl install -f uuid-1.0.4
- travis_retry composer self-update
- travis_retry ./resources/scripts/travis-before-install.sh
- ./resources/scripts/cmd-proxy.sh ./resources/scripts/system-info.sh
install:
- travis_retry composer require --no-update "php-coveralls/php-coveralls:^1 | ^2"
- travis_retry composer install --no-interaction --prefer-dist --no-progress --no-suggest
- travis_retry ./resources/scripts/cmd-proxy.sh composer require --no-update "php-coveralls/php-coveralls:^1 | ^2"
- travis_retry ./resources/scripts/cmd-proxy.sh composer install --no-interaction --prefer-dist --no-progress --no-suggest
before_script:
- mkdir -p build/logs
script:
- travis_wait composer run-script --timeout=1200 test-ci
- travis_wait ./resources/scripts/cmd-proxy.sh composer run-script --timeout=1200 test-ci
after_success:
- travis_retry ./resources/scripts/php-coveralls.sh
- travis_retry ./resources/scripts/cmd-proxy.sh ./resources/scripts/php-coveralls.sh
+20
View File
@@ -0,0 +1,20 @@
#!/bin/sh
#
# This script uses the ARCH environment variable to determine whether to run
# the commands through a 32-bit Docker container, for 32-bit testing. If the
# ARCH is anything other than "arm32," then it simply executes the commands
# on the local system, rather than in a container.
php_version=${TRAVIS_PHP_VERSION:-$(php -r "echo phpversion();")}
php_version=${php_version%.*}
architecture=${ARCH:-${TRAVIS_CPU_ARCH:-$(uname -m)}}
cmd_proxy=""
if [ "${architecture}" == "arm32" ]; then
image="benramsey/ramsey-uuid:php-${php_version}-arm32v7"
volumes="-v ${PWD}:/app -v ${HOME}/.composer:/root/.composer"
cmd_proxy="docker run -it --rm ${volumes} -w /app ${image}"
fi
$cmd_proxy $@
+1 -1
View File
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
set -e
+5 -3
View File
@@ -1,9 +1,9 @@
#!/bin/bash
#!/bin/sh
endianness=$(echo -n I | od -to2 | awk '{ print substr($2,6,1); exit}')
endianness=$(printf I | hexdump -o | awk '{ print substr($2,6,1); exit}')
endian="Big"
if [ $endianness -eq 1 ]; then
if [ "${endianness}" == "1" ]; then
endian="Little"
fi
@@ -15,3 +15,5 @@ echo
echo "CPU mode: $(getconf LONG_BIT)-bit"
echo "Endianness: ${endian}"
echo
php --version
echo
@@ -0,0 +1,15 @@
#!/bin/sh
#
# This script runs as part of the Travis CI before_install phase. If the ARCH
# environment variable is set and has the value "arm32," then we exit early,
# since we will use a pre-built Docker image to run commands instead.
architecture=${ARCH:-${TRAVIS_CPU_ARCH:-$(uname -m)}}
if [ "${architecture}" == "arm32" ]; then
exit
fi
yes '' | pecl install -f libsodium-1.0.7
yes '' | pecl install -f uuid-1.0.4
composer self-update