Skip to content

Commit ad8b334

Browse files
authored
Merge pull request php-enqueue#1139 from andrewmy/fix-matrix-2
Split tests into different matrices; fix highest/lowest dependencies
2 parents 351d80a + 1160afe commit ad8b334

File tree

26 files changed

+173
-177
lines changed

26 files changed

+173
-177
lines changed

.github/workflows/ci.yml

Lines changed: 80 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,18 @@ jobs:
4343
PATTERNS: |
4444
pkg/**/*.php
4545
46+
- name: Get Composer Cache Directory
47+
id: composer-cache
48+
run: |
49+
echo "::set-output name=dir::$(composer config cache-files-dir)"
50+
51+
- uses: actions/cache@v2
52+
with:
53+
path: ${{ steps.composer-cache.outputs.dir }}
54+
key: composer-cs-check-${{ hashFiles('**/composer.json') }}
55+
restore-keys: |
56+
composer-cs-check-
57+
4658
- uses: shivammathur/setup-php@v2
4759
with:
4860
php-version: '7.4'
@@ -52,103 +64,42 @@ jobs:
5264

5365
- run: php ./bin/fix-symfony-version.php "5.2.*"
5466

55-
- uses: "ramsey/composer-install@v1"
67+
- run: composer update --no-progress
5668

5769
- run: sed -i 's/525568/16777471/' vendor/kwn/php-rdkafka-stubs/stubs/constants.php
5870

5971
- run: ./bin/php-cs-fixer fix --config=.php_cs.php --no-interaction --dry-run --diff -v --path-mode=intersection -- ${{ env.GIT_DIFF_FILTERED }}
6072
if: env.GIT_DIFF_FILTERED
6173

62-
tests:
74+
unit_tests:
6375
runs-on: ubuntu-latest
6476
strategy:
6577
fail-fast: false
6678
matrix:
67-
php: ['7.4']
68-
include:
69-
- php: 7.3
70-
symfony_version: 4.3.*
71-
unit_tests: true
72-
functional_tests: false
73-
rdkafka_tests: false
74-
prepare_container: false
75-
- php: 7.3
76-
symfony_version: 4.4.*
77-
unit_tests: true
78-
functional_tests: false
79-
rdkafka_tests: false
80-
prepare_container: false
81-
- php: 7.3
82-
symfony_version: 5.0.*
83-
unit_tests: true
84-
functional_tests: false
85-
rdkafka_tests: false
86-
prepare_container: false
87-
- php: 7.4
88-
symfony_version: 4.3.*
89-
unit_tests: true
90-
functional_tests: false
91-
rdkafka_tests: false
92-
prepare_container: false
93-
- php: 7.4
94-
symfony_version: 4.4.*
95-
unit_tests: true
96-
functional_tests: false
97-
rdkafka_tests: false
98-
prepare_container: false
99-
- php: 7.4
100-
symfony_version: 5.0.*
101-
unit_tests: true
102-
functional_tests: false
103-
rdkafka_tests: false
104-
prepare_container: false
105-
- php: 7.4
106-
symfony_version: 5.2.*
107-
unit_tests: true
108-
functional_tests: false
109-
rdkafka_tests: false
110-
prepare_container: false
111-
- php: 7.3 # same as in the container
112-
symfony_version: 4.3.*
113-
unit_tests: false
114-
functional_tests: true
115-
rdkafka_tests: false
116-
prepare_container: true
117-
- php: 7.3 # same as in the container
118-
symfony_version: 5.0.*
119-
unit_tests: false
120-
functional_tests: true
121-
rdkafka_tests: false
122-
prepare_container: true
123-
- php: 7.3 # same as in the container
124-
symfony_version: 4.3.*
125-
unit_tests: false
126-
functional_tests: false
127-
rdkafka_tests: true
128-
prepare_container: true
129-
- php: "8.0"
130-
symfony_version: 5.2.*
131-
unit_tests: true
132-
functional_tests: false
133-
rdkafka_tests: false
134-
prepare_container: false
135-
- php: "8.0"
136-
symfony_version: 5.2.*
137-
unit_tests: false
138-
functional_tests: true
139-
rdkafka_tests: false
140-
prepare_container: true
141-
- php: "8.0"
142-
symfony_version: 5.2.*
143-
unit_tests: false
144-
rdkafka_tests: true
145-
prepare_container: true
146-
147-
name: PHP ${{ matrix.php }} tests on Sf ${{ matrix.symfony_version }}, unit=${{ matrix.unit_tests }}, func=${{ matrix.functional_tests }}, rdkafka=${{ matrix.rdkafka_tests }}
79+
php: ['7.3', '7.4', '8.0']
80+
symfony_version: ['4.4.*', '5.2.*']
81+
dependencies: ['--prefer-lowest', '--prefer-dist']
82+
exclude:
83+
- php: '8.0'
84+
symfony_version: '4.4.*'
85+
86+
name: PHP ${{ matrix.php }} unit tests on Sf ${{ matrix.symfony_version }}, deps=${{ matrix.dependencies }}
14887

14988
steps:
15089
- uses: actions/checkout@v2
15190

91+
- name: Get Composer Cache Directory
92+
id: composer-cache
93+
run: |
94+
echo "::set-output name=dir::$(composer config cache-files-dir)"
95+
96+
- uses: actions/cache@v2
97+
with:
98+
path: ${{ steps.composer-cache.outputs.dir }}
99+
key: composer-${{ matrix.php }}-${{ matrix.symfony_version }}-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }}
100+
restore-keys: |
101+
composer-${{ matrix.php }}-${{ matrix.symfony_version }}-${{ matrix.dependencies }}-
102+
152103
- uses: shivammathur/setup-php@v2
153104
with:
154105
php-version: ${{ matrix.php }}
@@ -158,20 +109,55 @@ jobs:
158109

159110
- run: php ./bin/fix-symfony-version.php "${{ matrix.symfony_version }}"
160111

161-
- uses: "ramsey/composer-install@v1"
112+
- run: composer update --no-progress ${{ matrix.dependencies }}
162113

163114
- run: sed -i 's/525568/16777471/' vendor/kwn/php-rdkafka-stubs/stubs/constants.php
164115

165-
- run: bin/dev -b
166-
env:
167-
PHP_VERSION: "${{ matrix.php }}"
168-
if: matrix.prepare_container
169-
170116
- run: bin/phpunit --exclude-group=functional
171-
if: matrix.unit_tests
172117

173-
- run: bin/test.sh --exclude-group=rdkafka
174-
if: matrix.functional_tests
118+
functional_tests:
119+
runs-on: ubuntu-latest
120+
strategy:
121+
fail-fast: false
122+
matrix:
123+
php: ['7.3', '8.0'] # same as in the container
124+
symfony_version: ['4.4.*', '5.2.*']
125+
dependencies: ['--prefer-lowest', '--prefer-dist']
126+
rdkafka_action: ['exclude-group', 'group']
127+
exclude:
128+
- php: '8.0'
129+
symfony_version: '4.4.*'
130+
131+
name: PHP ${{ matrix.php }} functional tests on Sf ${{ matrix.symfony_version }}, rdkafka_action=${{ matrix.rdkafka_action }}, deps=${{ matrix.dependencies }}
132+
133+
steps:
134+
- uses: actions/checkout@v2
135+
136+
- name: Get Composer Cache Directory
137+
id: composer-cache
138+
run: |
139+
echo "::set-output name=dir::$(composer config cache-files-dir)"
140+
141+
- uses: actions/cache@v2
142+
with:
143+
path: ${{ steps.composer-cache.outputs.dir }}
144+
key: composer-${{ matrix.php }}-${{ matrix.symfony_version }}-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }}
145+
restore-keys: |
146+
composer-${{ matrix.php }}-${{ matrix.symfony_version }}-${{ matrix.dependencies }}-
147+
148+
- uses: shivammathur/setup-php@v2
149+
with:
150+
php-version: ${{ matrix.php }}
151+
coverage: none
152+
extensions: mongodb, redis, :xdebug
153+
ini-values: memory_limit=2048M
154+
155+
- run: php ./bin/fix-symfony-version.php "${{ matrix.symfony_version }}"
156+
157+
- run: composer update --no-progress ${{ matrix.dependencies }}
158+
159+
- run: sed -i 's/525568/16777471/' vendor/kwn/php-rdkafka-stubs/stubs/constants.php
160+
161+
- run: bin/dev -b
175162

176-
- run: bin/test.sh --group=rdkafka
177-
if: matrix.rdkafka_tests
163+
- run: bin/test.sh --${{ matrix.rdkafka_action }}=rdkafka

composer.json

Lines changed: 35 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -20,53 +20,59 @@
2020
"ext-amqp": "^1.9.3",
2121
"ext-gearman": "^2.0",
2222
"ext-mongodb": "^1.5",
23-
"ext-rdkafka": "^3.0.3|^4.0|^5.0",
23+
"ext-rdkafka": "^4.0|^5.0",
2424

25-
"queue-interop/amqp-interop": "^0.8",
26-
"queue-interop/queue-interop": "^0.7|^0.8",
27-
"bunny/bunny": "^0.2.4|^0.3|^0.4",
28-
"php-amqplib/php-amqplib": "^2.7",
25+
"queue-interop/amqp-interop": "^0.8.2",
26+
"queue-interop/queue-interop": "^0.8.1",
27+
"bunny/bunny": "^0.4|^0.5",
28+
"php-amqplib/php-amqplib": "^2.12.1",
2929
"doctrine/dbal": "^2.12",
30-
"ramsey/uuid": "^2|^3.5|^4.0",
31-
"psr/log": "^1",
30+
"ramsey/uuid": "^3.5|^4",
31+
"psr/log": "^1.1",
3232
"psr/container": "^1",
3333
"makasim/temp-file": "^0.2",
34-
"google/cloud-pubsub": "^0.6.1|^1.0",
35-
"doctrine/orm": "~2.4",
34+
"google/cloud-pubsub": "^1.4.3",
35+
"doctrine/orm": "^2.7.4",
36+
"doctrine/persistence": "^1.3.3|^2.0",
3637
"mongodb/mongodb": "^1.2",
37-
"pda/pheanstalk": "^3",
38-
"aws/aws-sdk-php": "^3.26",
39-
"stomp-php/stomp-php": "^4|^5",
38+
"pda/pheanstalk": "^3.1",
39+
"aws/aws-sdk-php": "^3.155",
40+
"stomp-php/stomp-php": "^4.5|^5",
4041
"php-http/guzzle7-adapter": "^0.1.1",
4142
"php-http/client-common": "^2.2.1",
4243
"richardfullmer/rabbitmq-management-api": "^2.1.1",
4344
"predis/predis": "^1.1",
44-
"thruway/client": "^0.5.0",
45-
"thruway/pawl-transport": "^0.5.0",
45+
"thruway/client": "^0.5",
46+
"thruway/pawl-transport": "^0.5.1",
4647
"influxdb/influxdb-php": "^1.14",
47-
"datadog/php-datadogstatsd": "^1.3"
48+
"datadog/php-datadogstatsd": "^1.3",
49+
"guzzlehttp/guzzle": "^7.0.1",
50+
"php-http/discovery": "^1.13",
51+
"voryx/thruway-common": "^1.0.1",
52+
"react/dns": "^1.0",
53+
"react/event-loop": "^1.0"
4854
},
4955
"require-dev": {
5056
"ext-pcntl": "*",
5157
"phpunit/phpunit": "^9.5",
5258
"phpstan/phpstan": "^0.12",
53-
"queue-interop/queue-spec": "^0.6",
54-
"symfony/browser-kit": "^3.4|^4",
55-
"symfony/config": "^3.4|^4",
56-
"symfony/process": "^3.4|^4",
57-
"symfony/console": "^3.4|^4",
58-
"symfony/dependency-injection": "^3.4|^4",
59-
"symfony/event-dispatcher": "^3.4|^4",
60-
"symfony/expression-language": "^3.4|^4",
61-
"symfony/http-kernel": "^3.4|^4",
62-
"symfony/filesystem": "^3.4|^4",
63-
"symfony/framework-bundle": "^3.4|^4",
59+
"queue-interop/queue-spec": "^0.6.2",
60+
"symfony/browser-kit": "^4.3|^5",
61+
"symfony/config": "^4.3|^5",
62+
"symfony/process": "^4.3|^5",
63+
"symfony/console": "^4.3|^5",
64+
"symfony/dependency-injection": "^4.3|^5",
65+
"symfony/event-dispatcher": "^4.3|^5",
66+
"symfony/expression-language": "^4.3|^5",
67+
"symfony/http-kernel": "^4.3|^5",
68+
"symfony/filesystem": "^4.3|^5",
69+
"symfony/framework-bundle": "^4.3|^5",
6470
"symfony/yaml": "^4.3|^5",
6571
"empi89/php-amqp-stubs": "*@dev",
66-
"doctrine/doctrine-bundle": "~1.2|^2",
72+
"doctrine/doctrine-bundle": "^2.0",
6773
"doctrine/mongodb-odm-bundle": "^3.5|^4.3",
6874
"alcaeus/mongo-php-adapter": "^1.0",
69-
"kwn/php-rdkafka-stubs": "^1.0.2 | ^2.0",
75+
"kwn/php-rdkafka-stubs": "^2.0.3",
7076
"friendsofphp/php-cs-fixer": "^2",
7177
"dms/phpunit-arraysubset-asserts": "^0.2.1",
7278
"phpspec/prophecy-phpunit": "^2.0"
@@ -121,15 +127,12 @@
121127
"platform": {
122128
"ext-amqp": "1.9.3",
123129
"ext-gearman": "2.0.3",
124-
"ext-rdkafka": "3.3",
130+
"ext-rdkafka": "4.0",
125131
"ext-mongodb": "1.5",
126132
"ext-bcmath": "1",
127133
"ext-mbstring": "1",
128134
"ext-mongo": "1.6.14"
129135
},
130136
"prefer-stable": true
131-
},
132-
"conflict": {
133-
"doctrine/persistence": "<1.3.0"
134137
}
135138
}

docker/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ RUN set -x && \
2525
libgearman-dev \
2626
php-pear \
2727
make \
28+
unzip \
2829
&& \
2930
pecl channel-update pecl.php.net && \
3031
pecl install gearman && \
@@ -56,4 +57,6 @@ RUN chmod u+x /usr/local/bin/entrypoint.sh
5657
RUN mkdir -p /mqdev
5758
WORKDIR /mqdev
5859

60+
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
61+
5962
CMD /usr/local/bin/entrypoint.sh

pkg/amqp-bunny/composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@
77
"license": "MIT",
88
"require": {
99
"php": "^7.3|^8.0",
10-
"queue-interop/amqp-interop": "^0.8",
10+
"queue-interop/amqp-interop": "^0.8.2",
1111
"queue-interop/queue-interop": "^0.8",
12-
"bunny/bunny": "^0.4",
12+
"bunny/bunny": "^0.4|^0.5",
1313
"enqueue/amqp-tools": "^0.10"
1414
},
1515
"require-dev": {
1616
"phpunit/phpunit": "^9.5",
1717
"enqueue/test": "0.10.x-dev",
1818
"enqueue/null": "0.10.x-dev",
19-
"queue-interop/queue-spec": "^0.6"
19+
"queue-interop/queue-spec": "^0.6.2"
2020
},
2121
"support": {
2222
"email": "opensource@forma-pro.com",

pkg/amqp-ext/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
"require": {
99
"php": "^7.3|^8.0",
1010
"ext-amqp": "^1.9.3",
11-
"queue-interop/amqp-interop": "^0.8",
11+
"queue-interop/amqp-interop": "^0.8.2",
1212
"queue-interop/queue-interop": "^0.8",
1313
"enqueue/amqp-tools": "^0.10"
1414
},
1515
"require-dev": {
1616
"phpunit/phpunit": "^9.5",
1717
"enqueue/test": "0.10.x-dev",
1818
"enqueue/null": "0.10.x-dev",
19-
"queue-interop/queue-spec": "^0.6",
19+
"queue-interop/queue-spec": "^0.6.2",
2020
"empi89/php-amqp-stubs": "*@dev"
2121
},
2222
"support": {

pkg/amqp-lib/composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@
77
"license": "MIT",
88
"require": {
99
"php": "^7.3|^8.0",
10-
"php-amqplib/php-amqplib": "^2.10",
11-
"queue-interop/amqp-interop": "^0.8",
10+
"php-amqplib/php-amqplib": "^2.12.1",
11+
"queue-interop/amqp-interop": "^0.8.2",
1212
"queue-interop/queue-interop": "^0.8",
1313
"enqueue/amqp-tools": "^0.10"
1414
},
1515
"require-dev": {
1616
"phpunit/phpunit": "^9.5",
1717
"enqueue/test": "0.10.x-dev",
1818
"enqueue/null": "0.10.x-dev",
19-
"queue-interop/queue-spec": "^0.6"
19+
"queue-interop/queue-spec": "^0.6.2"
2020
},
2121
"support": {
2222
"email": "opensource@forma-pro.com",

pkg/amqp-tools/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"license": "MIT",
88
"require": {
99
"php": "^7.3|^8.0",
10-
"queue-interop/amqp-interop": "^0.8",
10+
"queue-interop/amqp-interop": "^0.8.2",
1111
"queue-interop/queue-interop": "^0.8",
1212
"enqueue/dsn": "^0.10"
1313
},

0 commit comments

Comments
 (0)