2020-05-01 13:33:43 +01:00
|
|
|
name: Tests
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
pull_request:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
|
|
|
integration:
|
|
|
|
name: Integration
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
php: ['7.1', '7.4']
|
|
|
|
|
|
|
|
services:
|
|
|
|
redis:
|
|
|
|
image: redis:6.0.0
|
|
|
|
ports:
|
|
|
|
- 6379:6379
|
|
|
|
redis-cluster:
|
|
|
|
image: grokzen/redis-cluster:5.0.4
|
|
|
|
ports:
|
|
|
|
- 7000:7000
|
|
|
|
- 7001:7001
|
|
|
|
- 7002:7002
|
|
|
|
- 7003:7003
|
|
|
|
- 7004:7004
|
|
|
|
- 7005:7005
|
|
|
|
- 7006:7006
|
|
|
|
- 7007:7007
|
|
|
|
env:
|
|
|
|
STANDALONE: true
|
|
|
|
memcached:
|
|
|
|
image: memcached:1.6.5
|
|
|
|
ports:
|
|
|
|
- 11211:11211
|
|
|
|
rabbitmq:
|
|
|
|
image: rabbitmq:3.8.3
|
|
|
|
ports:
|
|
|
|
- 5672:5672
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Setup PHP
|
|
|
|
uses: shivammathur/setup-php@v2
|
|
|
|
with:
|
|
|
|
coverage: "none"
|
|
|
|
extensions: "memcached,redis,xsl"
|
|
|
|
ini-values: "memory_limit=-1"
|
|
|
|
php-version: "${{ matrix.php }}"
|
|
|
|
tools: flex
|
|
|
|
|
|
|
|
- name: Configure composer
|
|
|
|
run: |
|
|
|
|
([ -d ~/.composer ] || mkdir ~/.composer) && cp .github/composer-config.json ~/.composer/config.json
|
|
|
|
SYMFONY_VERSION=$(cat composer.json | grep '^ *\"dev-master\". *\"[1-9]' | grep -o '[0-9.]*')
|
|
|
|
echo "::set-env name=SYMFONY_VERSION::$SYMFONY_VERSION"
|
|
|
|
echo "::set-env name=COMPOSER_ROOT_VERSION::$SYMFONY_VERSION.x-dev"
|
|
|
|
|
|
|
|
- name: Determine composer cache directory
|
|
|
|
id: composer-cache
|
|
|
|
run: echo "::set-output name=directory::$(composer config cache-dir)"
|
|
|
|
|
|
|
|
- name: Cache composer dependencies
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ${{ steps.composer-cache.outputs.directory }}
|
|
|
|
key: ${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
|
|
|
|
restore-keys: ${{ matrix.php }}-composer-
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
echo "::group::composer update"
|
|
|
|
composer update --no-progress --no-suggest --ansi
|
|
|
|
echo "::endgroup::"
|
|
|
|
echo "::group::install phpunit"
|
|
|
|
./phpunit install
|
|
|
|
echo "::endgroup::"
|
|
|
|
|
|
|
|
- name: Run tests
|
2020-05-08 11:04:23 +01:00
|
|
|
run: ./phpunit --group integration
|
2020-05-01 13:33:43 +01:00
|
|
|
env:
|
|
|
|
REDIS_HOST: localhost
|
|
|
|
REDIS_CLUSTER_HOSTS: 'localhost:7000 localhost:7001 localhost:7002 localhost:7003 localhost:7004 localhost:7005'
|
|
|
|
MESSENGER_REDIS_DSN: redis://127.0.0.1:7006/messages
|
|
|
|
MESSENGER_AMQP_DSN: amqp://localhost/%2f/messages
|
|
|
|
MEMCACHED_HOST: localhost
|
|
|
|
|
|
|
|
- name: Run HTTP push tests
|
|
|
|
if: matrix.php == '7.4'
|
|
|
|
run: |
|
|
|
|
[ -d .phpunit ] && mv .phpunit .phpunit.bak
|
|
|
|
wget -q https://github.com/symfony/binary-utils/releases/download/v0.1/vulcain_0.1.3_Linux_x86_64.tar.gz -O - | tar xz && mv vulcain /usr/local/bin
|
2020-05-08 11:04:23 +01:00
|
|
|
docker run --rm -e COMPOSER_ROOT_VERSION -e SYMFONY_VERSION -v $(pwd):/app -v $(which composer):/usr/local/bin/composer -v /usr/local/bin/vulcain:/usr/local/bin/vulcain -w /app php:7.4-alpine ./phpunit src/Symfony/Component/HttpClient/Tests/CurlHttpClientTest.php --filter testHttp2Push
|
2020-05-01 13:33:43 +01:00
|
|
|
sudo rm -rf .phpunit
|
|
|
|
[ -d .phpunit.bak ] && mv .phpunit.bak .phpunit
|