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/integration-tests.yml
2021-07-16 13:56:54 +02:00

120 lines
4.0 KiB
YAML

name: Integration
on:
push:
pull_request:
defaults:
run:
shell: bash
jobs:
tests:
name: Tests
runs-on: Ubuntu-20.04
strategy:
matrix:
php: ['7.1', '8.0']
services:
ldap:
image: bitnami/openldap
ports:
- 3389:3389
env:
LDAP_ADMIN_USERNAME: admin
LDAP_ADMIN_PASSWORD: symfony
LDAP_ROOT: dc=symfony,dc=com
LDAP_PORT_NUMBER: 3389
LDAP_USERS: a
LDAP_PASSWORDS: a
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
env:
STANDALONE: 1
redis-sentinel:
image: bitnami/redis-sentinel:6.0
ports:
- 26379:26379
env:
REDIS_MASTER_HOST: redis
REDIS_MASTER_SET: redis_sentinel
REDIS_SENTINEL_QUORUM: 1
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,ldap"
ini-values: date.timezone=Europe/Paris,memory_limit=-1,default_socket_timeout=10,session.gc_probability=0,apc.enable_cli=1,zend.assertions=1
php-version: "${{ matrix.php }}"
- name: Load fixtures
uses: docker://bitnami/openldap
with:
entrypoint: /bin/bash
args: -c "(/opt/bitnami/openldap/bin/ldapwhoami -H ldap://ldap:3389 -D cn=admin,dc=symfony,dc=com -w symfony||sleep 5) && /opt/bitnami/openldap/bin/ldapadd -H ldap://ldap:3389 -D cn=admin,dc=symfony,dc=com -w symfony -f src/Symfony/Component/Ldap/Tests/Fixtures/data/fixtures.ldif && /opt/bitnami/openldap/bin/ldapdelete -H ldap://ldap:3389 -D cn=admin,dc=symfony,dc=com -w symfony cn=a,ou=users,dc=symfony,dc=com"
- name: Install dependencies
run: |
COMPOSER_HOME="$(composer config home)"
([ -d "$COMPOSER_HOME" ] || mkdir "$COMPOSER_HOME") && cp .github/composer-config.json "$COMPOSER_HOME/config.json"
export COMPOSER_ROOT_VERSION=$(grep ' VERSION = ' src/Symfony/Component/HttpKernel/Kernel.php | grep -P -o '[0-9]+\.[0-9]+').x-dev
echo COMPOSER_ROOT_VERSION=$COMPOSER_ROOT_VERSION >> $GITHUB_ENV
echo "::group::composer update"
composer update --no-progress --ansi
echo "::endgroup::"
echo "::group::install phpunit"
./phpunit install
echo "::endgroup::"
- name: Run tests
run: ./phpunit --group integration -v
env:
REDIS_HOST: localhost
REDIS_CLUSTER_HOSTS: 'localhost:7000 localhost:7001 localhost:7002 localhost:7003 localhost:7004 localhost:7005'
REDIS_SENTINEL_HOSTS: 'localhost:26379'
REDIS_SENTINEL_SERVICE: redis_sentinel
MESSENGER_REDIS_DSN: redis://127.0.0.1:7006/messages
MESSENGER_AMQP_DSN: amqp://localhost/%2f/messages
MEMCACHED_HOST: localhost
LDAP_HOST: localhost
LDAP_PORT: 3389
#- name: Run HTTP push tests
# if: matrix.php == '8.0'
# 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 -v $(pwd):/app -v $(which composer):/usr/local/bin/composer -v $(which vulcain):/usr/local/bin/vulcain -w /app php:8.0-alpine ./phpunit src/Symfony/Component/HttpClient/Tests/CurlHttpClientTest.php --filter testHttp2Push
# sudo rm -rf .phpunit
# [ -d .phpunit.bak ] && mv .phpunit.bak .phpunit