This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/.github/workflows/tests.yml
Fabien Potencier 6987862d97 Merge branch '5.1' into 5.x
* 5.1:
  Don't skip Doctrine tests on php 8.
  Stop using set-env in GitHub actions.
  Allow setting AMQP option "login"
  Bump igbinary to v3.1.6
  Add myself to CODEOWNERS for Form, OptionsResolver and TwigBundle
  Reference the correct interface in the RegistryInterface deprecation in upgrade notes
  Add myself to CODEOWNERS for Security and Console
  Add wouterj as codeowner for Security related packages
2020-10-20 08:22:43 +02:00

163 lines
6.8 KiB
YAML

name: Tests
on:
push:
pull_request:
jobs:
integration:
name: Integration
runs-on: ubuntu-latest
strategy:
matrix:
php: ['7.2', '7.4']
services:
postgres:
image: postgres:9.6-alpine
ports:
- 5432:5432
env:
POSTGRES_PASSWORD: 'password'
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
mongodb:
image: mongo
ports:
- 27017:27017
couchbase:
image: couchbase:6.5.1
ports:
- 8091:8091
- 8092:8092
- 8093:8093
- 8094:8094
- 11210:11210
sqs:
image: asyncaws/testing-sqs
ports:
- 9494:9494
zookeeper:
image: wurstmeister/zookeeper:3.4.6
kafka:
image: wurstmeister/kafka:2.12-2.4.1
ports:
- 9092:9092
env:
KAFKA_AUTO_CREATE_TOPICS_ENABLE: false
KAFKA_CREATE_TOPICS: 'test-topic:1:1:compact'
KAFKA_ADVERTISED_HOST_NAME: localhost
KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181'
KAFKA_ADVERTISED_PORT: 9092
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install system dependencies
run: |
echo "::group::add apt sources"
sudo wget -O - http://packages.couchbase.com/ubuntu/couchbase.key | sudo apt-key add -
echo "deb http://packages.couchbase.com/ubuntu bionic bionic/main" | sudo tee /etc/apt/sources.list.d/couchbase.list
echo "::endgroup::"
echo "::group::apt-get update"
sudo apt-get update
echo "::endgroup::"
echo "::group::install tools & libraries"
sudo apt-get install libcouchbase-dev librdkafka-dev
echo "::endgroup::"
- name: Configure Couchbase
run: |
curl -s -u 'username=Administrator&password=111111' -X POST http://localhost:8091/node/controller/setupServices -d 'services=kv%2Cn1ql%2Cindex%2Cfts'
curl -s -X POST http://localhost:8091/settings/web -d 'username=Administrator&password=111111&port=SAME'
curl -s -u Administrator:111111 -X POST http://localhost:8091/pools/default/buckets -d 'ramQuotaMB=100&bucketType=ephemeral&name=cache'
curl -s -u Administrator:111111 -X POST http://localhost:8091/pools/default -d 'memoryQuota=256'
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
coverage: "none"
extensions: "json,couchbase,memcached,mongodb,redis,rdkafka,xsl"
ini-values: "memory_limit=-1"
php-version: "${{ matrix.php }}"
tools: flex,pecl
- name: Configure composer
run: |
([ -d ~/.composer ] || mkdir ~/.composer) && cp .github/composer-config.json ~/.composer/config.json
SYMFONY_VERSION=$(cat composer.json | grep '^ *\"branch-version\". *\"[1-9]' | grep -o '[0-9.]*')
echo "SYMFONY_VERSION=$SYMFONY_VERSION" >> $GITHUB_ENV
echo "COMPOSER_ROOT_VERSION=$SYMFONY_VERSION.x-dev" >> $GITHUB_ENV
- 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 require --dev --no-update mongodb/mongodb:@stable
composer update --no-progress --no-suggest --ansi
echo "::endgroup::"
echo "::group::install phpunit"
./phpunit install
echo "::endgroup::"
- name: Run tests
run: ./phpunit --group integration
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
MESSENGER_SQS_DSN: "sqs://localhost:9494/messages?sslmode=disable&poll_timeout=0.01"
MESSENGER_SQS_FIFO_QUEUE_DSN: "sqs://localhost:9494/messages.fifo?sslmode=disable&poll_timeout=0.01"
MEMCACHED_HOST: localhost
MONGODB_HOST: localhost
KAFKA_BROKER: localhost:9092
POSTGRES_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
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
sudo rm -rf .phpunit
[ -d .phpunit.bak ] && mv .phpunit.bak .phpunit