2020-05-01 13:33:43 +01:00
|
|
|
name: Tests
|
|
|
|
|
|
|
|
on:
|
2021-02-25 19:32:02 +00:00
|
|
|
push:
|
|
|
|
pull_request:
|
2020-05-01 13:33:43 +01:00
|
|
|
|
2021-02-25 23:54:56 +00:00
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
2020-05-01 13:33:43 +01:00
|
|
|
|
2021-02-25 23:54:56 +00:00
|
|
|
jobs:
|
2021-02-25 19:32:02 +00:00
|
|
|
integration:
|
|
|
|
name: Integration
|
2021-03-02 09:27:35 +00:00
|
|
|
runs-on: Ubuntu-20.04
|
2020-05-01 13:33:43 +01:00
|
|
|
|
2021-02-25 19:32:02 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2021-02-25 23:54:56 +00:00
|
|
|
php: ['7.2', '7.4']
|
2020-05-01 13:33:43 +01:00
|
|
|
|
2021-02-25 19:32:02 +00:00
|
|
|
services:
|
2021-02-25 23:54:56 +00:00
|
|
|
postgres:
|
|
|
|
image: postgres:9.6-alpine
|
|
|
|
ports:
|
|
|
|
- 5432:5432
|
|
|
|
env:
|
|
|
|
POSTGRES_PASSWORD: 'password'
|
2021-02-25 19:32:02 +00:00
|
|
|
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
|
2021-02-25 23:54:56 +00:00
|
|
|
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: 127.0.0.1
|
|
|
|
KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181'
|
|
|
|
KAFKA_ADVERTISED_PORT: 9092
|
2020-05-01 13:33:43 +01:00
|
|
|
|
2021-02-25 19:32:02 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
2020-05-01 13:33:43 +01:00
|
|
|
|
2021-02-25 23:54:56 +00:00
|
|
|
- name: Install system dependencies
|
|
|
|
run: |
|
|
|
|
echo "::group::apt-get update"
|
|
|
|
sudo apt-get update
|
|
|
|
echo "::endgroup::"
|
|
|
|
|
|
|
|
echo "::group::install tools & libraries"
|
|
|
|
sudo apt-get install 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'
|
|
|
|
|
2021-02-25 19:32:02 +00:00
|
|
|
- name: Setup PHP
|
|
|
|
uses: shivammathur/setup-php@v2
|
|
|
|
with:
|
|
|
|
coverage: "none"
|
2021-02-25 23:54:56 +00:00
|
|
|
extensions: "json,couchbase,memcached,mongodb,redis,rdkafka,xsl,ldap"
|
2021-02-25 19:32:02 +00:00
|
|
|
ini-values: "memory_limit=-1"
|
|
|
|
php-version: "${{ matrix.php }}"
|
2021-02-25 23:54:56 +00:00
|
|
|
tools: pecl
|
|
|
|
|
|
|
|
- name: Display versions
|
|
|
|
run: |
|
|
|
|
php -r 'foreach (get_loaded_extensions() as $extension) echo $extension . " " . phpversion($extension) . PHP_EOL;'
|
|
|
|
php -i
|
2020-05-01 13:33:43 +01:00
|
|
|
|
2021-02-25 19:32:02 +00:00
|
|
|
- name: Load fixtures
|
|
|
|
uses: docker://bitnami/openldap
|
|
|
|
with:
|
|
|
|
entrypoint: /bin/bash
|
|
|
|
args: -c "(/opt/bitnami/openldap/bin/ldapwhoami -h localhost:3389 -D cn=admin,dc=symfony,dc=com -w symfony||sleep 5) && /opt/bitnami/openldap/bin/ldapadd -h 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:3389 -D cn=admin,dc=symfony,dc=com -w symfony cn=a,ou=users,dc=symfony,dc=com"
|
2020-11-16 08:41:36 +00:00
|
|
|
|
2021-02-25 19:32:02 +00:00
|
|
|
- name: Configure composer
|
|
|
|
run: |
|
|
|
|
COMPOSER_HOME="$(composer config home)"
|
|
|
|
composer self-update
|
|
|
|
([ -d "$COMPOSER_HOME" ] || mkdir "$COMPOSER_HOME") && cp .github/composer-config.json "$COMPOSER_HOME/config.json"
|
|
|
|
echo "COMPOSER_ROOT_VERSION=$(grep -m1 SYMFONY_VERSION .travis.yml | grep -o '[0-9.x]*').x-dev" >> $GITHUB_ENV
|
2020-05-01 13:33:43 +01:00
|
|
|
|
2021-02-25 23:54:56 +00:00
|
|
|
- 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-
|
|
|
|
|
2021-02-25 19:32:02 +00:00
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
echo "::group::composer update"
|
2021-02-25 23:54:56 +00:00
|
|
|
composer require --dev --no-update mongodb/mongodb:@stable
|
2021-02-25 19:32:02 +00:00
|
|
|
composer update --no-progress --ansi
|
|
|
|
echo "::endgroup::"
|
|
|
|
echo "::group::install phpunit"
|
|
|
|
./phpunit install
|
|
|
|
echo "::endgroup::"
|
2020-05-01 13:33:43 +01:00
|
|
|
|
2021-02-25 19:32:02 +00:00
|
|
|
- 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
|
2021-02-25 23:54:56 +00:00
|
|
|
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"
|
2021-02-25 19:32:02 +00:00
|
|
|
MEMCACHED_HOST: localhost
|
|
|
|
LDAP_HOST: localhost
|
|
|
|
LDAP_PORT: 3389
|
2021-02-25 23:54:56 +00:00
|
|
|
MONGODB_HOST: localhost
|
|
|
|
KAFKA_BROKER: 127.0.0.1:9092
|
|
|
|
POSTGRES_HOST: localhost
|
2020-05-01 13:33:43 +01:00
|
|
|
|
2021-02-25 19:32:02 +00:00
|
|
|
- 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 -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
|
2021-05-03 01:08:44 +01:00
|
|
|
|
|
|
|
nightly:
|
|
|
|
name: PHPUnit on PHP nightly
|
|
|
|
runs-on: Ubuntu-20.04
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Setup PHP
|
|
|
|
uses: shivammathur/setup-php@v2
|
|
|
|
with:
|
|
|
|
coverage: "none"
|
|
|
|
ini-values: "memory_limit=-1"
|
|
|
|
php-version: "8.1"
|
|
|
|
|
|
|
|
- name: Configure composer
|
|
|
|
run: |
|
|
|
|
COMPOSER_HOME="$(composer config home)"
|
|
|
|
composer self-update
|
|
|
|
([ -d "$COMPOSER_HOME" ] || mkdir "$COMPOSER_HOME") && cp .github/composer-config.json "$COMPOSER_HOME/config.json"
|
|
|
|
echo "COMPOSER_ROOT_VERSION=$(grep -m1 SYMFONY_VERSION .travis.yml | grep -o '[0-9.x]*').x-dev" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
echo "::group::fake PHP version"
|
|
|
|
composer config platform.php 8.0.99
|
|
|
|
echo "::group::composer update"
|
|
|
|
composer update --no-progress --ansi
|
|
|
|
echo "::endgroup::"
|
|
|
|
echo "::group::install phpunit"
|
|
|
|
./phpunit install
|
|
|
|
echo "::endgroup::"
|
|
|
|
|
|
|
|
- name: Run tests
|
2021-05-14 16:39:55 +01:00
|
|
|
run: |
|
|
|
|
_run_tests() {
|
|
|
|
ok=0
|
|
|
|
echo "::group::$1"
|
|
|
|
|
|
|
|
# Run the tests
|
2021-05-15 09:42:08 +01:00
|
|
|
./phpunit --colors=always --exclude-group tty,benchmark,intl-data ./$1 2>&1 || ok=1
|
2021-05-14 16:39:55 +01:00
|
|
|
echo ::endgroup::
|
|
|
|
|
|
|
|
if [ $ok -ne 0 ]; then
|
|
|
|
echo "::error::$1 failed"
|
|
|
|
fi
|
|
|
|
|
2021-05-14 19:01:46 +01:00
|
|
|
# Make the tests always pass because we don't want the build to fail (yet).
|
|
|
|
return 0
|
|
|
|
#return $ok
|
2021-05-14 16:39:55 +01:00
|
|
|
}
|
|
|
|
export -f _run_tests
|
|
|
|
|
|
|
|
find src/Symfony -mindepth 2 -type f -name phpunit.xml.dist -not -wholename '*/Bridge/PhpUnit/*' -print0 | xargs -0 -n1 dirname | sort | parallel _run_tests
|