2020-05-05 14:58:23 -05:00
|
|
|
dist: bionic
|
|
|
|
|
2016-04-17 12:34:16 -05:00
|
|
|
language: php
|
|
|
|
|
|
|
|
branches:
|
|
|
|
only:
|
2017-12-27 08:43:59 -06:00
|
|
|
- /.*/
|
2016-04-17 12:34:16 -05:00
|
|
|
|
2020-06-10 10:51:20 -05:00
|
|
|
services:
|
|
|
|
- docker
|
|
|
|
|
|
|
|
cache:
|
|
|
|
directories:
|
|
|
|
- $HOME/.composer/cache/files
|
|
|
|
|
2020-05-16 06:28:29 -05:00
|
|
|
jobs:
|
2020-05-16 15:01:20 -05:00
|
|
|
fast_finish: true
|
2020-07-23 09:34:25 -05:00
|
|
|
allow_failures:
|
|
|
|
- php: 'nightly'
|
2020-05-16 06:28:29 -05:00
|
|
|
include:
|
2020-07-23 09:34:25 -05:00
|
|
|
- name: "CI - 8.0"
|
|
|
|
php: 'nightly'
|
|
|
|
env:
|
|
|
|
- COMPOSER_FLAGS='--ignore-platform-reqs'
|
|
|
|
- name: "CI - 7.4"
|
2020-05-16 06:28:29 -05:00
|
|
|
php: '7.4'
|
2020-07-23 09:34:25 -05:00
|
|
|
env:
|
|
|
|
- COMPOSER_FLAGS=''
|
2019-11-09 04:25:33 -06:00
|
|
|
|
2017-10-23 04:37:16 -05:00
|
|
|
before_install:
|
2020-05-04 14:39:48 -05:00
|
|
|
- echo 'extension = apcu.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
|
2018-11-03 05:02:52 -05:00
|
|
|
- phpenv config-rm xdebug.ini || return 0
|
2020-06-10 10:51:20 -05:00
|
|
|
- sudo ./data/infra/ci/install-ms-odbc.sh
|
|
|
|
- docker-compose -f docker-compose.yml -f docker-compose.ci.yml up -d shlink_db_ms shlink_db shlink_db_postgres shlink_db_maria
|
2020-10-16 12:28:57 -05:00
|
|
|
- yes | pecl install pdo_sqlsrv-5.9.0preview1 swoole-4.5.5 pcov
|
2016-08-09 11:50:14 -05:00
|
|
|
|
2018-09-24 12:38:22 -05:00
|
|
|
install:
|
2020-10-25 11:59:37 -05:00
|
|
|
- composer self-update
|
2020-07-23 09:34:25 -05:00
|
|
|
- composer install --no-interaction --prefer-dist $COMPOSER_FLAGS
|
2016-04-17 12:34:16 -05:00
|
|
|
|
2019-03-05 13:50:32 -06:00
|
|
|
before_script:
|
2020-06-10 10:51:20 -05:00
|
|
|
- docker-compose exec shlink_db_ms /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P 'Passw0rd!' -Q "CREATE DATABASE shlink_test;"
|
2019-03-05 13:58:48 -06:00
|
|
|
- mkdir build
|
2020-06-21 05:21:39 -05:00
|
|
|
- export DOCKERFILE_CHANGED=$(git diff ${TRAVIS_COMMIT_RANGE:-origin/main} --name-only | grep Dockerfile)
|
2019-03-05 13:50:32 -06:00
|
|
|
|
2016-04-17 12:34:16 -05:00
|
|
|
script:
|
2020-09-23 00:49:59 -05:00
|
|
|
- composer ci
|
2020-09-26 04:16:35 -05:00
|
|
|
- bin/test/run-api-tests.sh
|
2020-06-10 10:51:20 -05:00
|
|
|
- if [[ ! -z "${DOCKERFILE_CHANGED}" && "${TRAVIS_PHP_VERSION}" == "7.4" ]]; then docker build -t shlink-docker-image:temp . ; fi
|
2016-04-17 12:34:16 -05:00
|
|
|
|
2018-09-24 12:38:22 -05:00
|
|
|
after_success:
|
2018-11-03 04:58:46 -05:00
|
|
|
- rm -f build/clover.xml
|
2020-06-10 10:51:20 -05:00
|
|
|
- wget https://phar.phpunit.de/phpcov-7.0.2.phar
|
2020-09-26 03:43:50 -05:00
|
|
|
- php phpcov-7.0.2.phar merge build --clover build/clover.xml
|
2020-06-10 10:51:20 -05:00
|
|
|
- wget https://scrutinizer-ci.com/ocular.phar
|
|
|
|
- php ocular.phar code-coverage:upload --format=php-clover build/clover.xml
|