@@ -10,28 +10,9 @@ concurrency:
1010
1111env :
1212 COMPOSER_TOKEN : ${{ secrets.GITHUB_TOKEN }}
13+ COMPOSER_ROOT_VERSION : " 4.1.x-dev"
1314
1415jobs :
15- commitlint :
16- if : github.event_name == 'pull_request'
17- env :
18- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
19- runs-on : ubuntu-latest
20- steps :
21- - uses : actions/checkout@v4
22- with :
23- fetch-depth : 0
24- - name : Run commitlint
25- run : |
26- commit=$(gh api \
27- /repos/${{ github.repository }}/pulls/${{github.event.number}}/commits \
28- | jq -r '.[0].commit.message' \
29- | head -n 1)
30- # we can't use npx see https://github.com/conventional-changelog/commitlint/issues/613
31- echo '{}' > package.json
32- npm install --no-fund --no-audit @commitlint/config-conventional @commitlint/cli
33- echo $commit | ./node_modules/.bin/commitlint -g .commitlintrc
34-
3516 architecture :
3617 name : Check components interdependencies
3718 runs-on : ubuntu-latest
@@ -264,7 +245,7 @@ jobs:
264245 continue-on-error : true
265246
266247 phpunit-components :
267- name : PHPUnit ${{ matrix.component }} (PHP ${{ matrix.php.version }} ${{ matrix.php.coverage && 'coverage' || '' }}
248+ name : PHPUnit ${{ matrix.component }} (PHP ${{ matrix.php.version }} ${{ matrix.php.coverage && 'coverage' || '' }}${{ matrix.php.lowest && 'lowest' || '' }})
268249 runs-on : ubuntu-latest
269250 timeout-minutes : 20
270251 strategy :
@@ -274,6 +255,8 @@ jobs:
274255 - version : ' 8.3'
275256 - version : ' 8.4'
276257 coverage : true
258+ - version : ' 8.4'
259+ lowest : true
277260 component :
278261 - api-platform/doctrine-common
279262 - api-platform/doctrine-orm
@@ -302,18 +285,24 @@ jobs:
302285 tools : pecl, composer
303286 extensions : intl, bcmath, curl, openssl, mbstring, pdo_sqlite, mongodb
304287 ini-values : memory_limit=-1
305- - name : Linking
288+ - name : PMU
306289 run : |
307290 composer global require soyuka/pmu
308291 composer global config allow-plugins.soyuka/pmu true --no-interaction
292+ - name : Linking
293+ if : ${{ !matrix.php.lowest }}
294+ run : |
309295 composer global link . --permanent
296+ composer ${{matrix.component}} update
310297 - name : Run ${{ matrix.component }} install
298+ if : ${{ matrix.php.lowest }}
311299 run : |
312- composer ${{matrix.component}} update
300+ cd $(composer ${{matrix.component}} --cwd)
301+ composer update${{ matrix.php.lowest && ' --prefer-lowest --prefer-source' || '' }}
313302 - name : Run ${{ matrix.component }} tests
314303 run : |
315304 mkdir -p /tmp/build/logs/phpunit
316- composer ${{matrix.component}} test --log-junit "/tmp/build/logs/phpunit/junit.xml" ${{ matrix.php.coverage && '--coverage-clover /tmp/build/logs/phpunit/clover.xml' || '' }}
305+ composer ${{matrix.component}} test -- -- log-junit "/tmp/build/logs/phpunit/junit.xml" ${{ matrix.php.coverage && '--coverage-clover /tmp/build/logs/phpunit/clover.xml' || '' }}${{ matrix.php.lowest && ' --ignore-baseline ' || '' }}
317306 - name : Upload test artifacts
318307 if : always()
319308 uses : actions/upload-artifact@v4
@@ -769,8 +758,60 @@ jobs:
769758 php-coveralls --coverage_clover=build/logs/behat/clover.xml
770759 continue-on-error : true
771760
772- elasticsearch :
773- name : Behat (PHP ${{ matrix.php }}) (Elasticsearch)
761+ elasticsearch-v9 :
762+ name : Behat (PHP ${{ matrix.php }}) (Elasticsearch v9)
763+ runs-on : ubuntu-latest
764+ timeout-minutes : 20
765+ strategy :
766+ matrix :
767+ php :
768+ - ' 8.4'
769+ fail-fast : false
770+ env :
771+ APP_ENV : elasticsearch
772+ steps :
773+ - name : Checkout
774+ uses : actions/checkout@v4
775+ - name : Configure sysctl limits
776+ run : |
777+ sudo swapoff -a
778+ sudo sysctl -w vm.swappiness=1
779+ sudo sysctl -w fs.file-max=262144
780+ sudo sysctl -w vm.max_map_count=262144
781+ - name : Runs Elasticsearch
782+ uses : elastic/elastic-github-actions/elasticsearch@master
783+ with :
784+ stack-version : ' 9.0.0'
785+ security-enabled : false
786+ - name : Setup PHP
787+ uses : shivammathur/setup-php@v2
788+ with :
789+ php-version : ${{ matrix.php }}
790+ tools : pecl, composer
791+ extensions : intl, bcmath, curl, openssl, mbstring, mongodb
792+ coverage : none
793+ ini-values : memory_limit=-1
794+ - name : Get composer cache directory
795+ id : composercache
796+ run : echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
797+ - name : Cache dependencies
798+ uses : actions/cache@v4
799+ with :
800+ path : ${{ steps.composercache.outputs.dir }}
801+ key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
802+ restore-keys : ${{ runner.os }}-composer-
803+ - name : Update project dependencies
804+ run : |
805+ composer global require soyuka/pmu
806+ composer global config allow-plugins.soyuka/pmu true --no-interaction
807+ composer global link .
808+ - name : Clear test app cache
809+ run : tests/Fixtures/app/console cache:clear --ansi
810+ - name : Run Behat tests
811+ run : vendor/bin/behat --out=std --format=progress --profile=elasticsearch --no-interaction
812+
813+ elasticsearch-v8 :
814+ name : Behat (PHP ${{ matrix.php }}) (Elasticsearch v8)
774815 runs-on : ubuntu-latest
775816 timeout-minutes : 20
776817 strategy :
@@ -816,6 +857,7 @@ jobs:
816857 composer global require soyuka/pmu
817858 composer global config allow-plugins.soyuka/pmu true --no-interaction
818859 composer global link .
860+ composer require elasticsearch/elasticsearch "^8.4" -W
819861 - name : Clear test app cache
820862 run : tests/Fixtures/app/console cache:clear --ansi
821863 - name : Run Behat tests
@@ -1026,15 +1068,16 @@ jobs:
10261068 ini-values : memory_limit=-1
10271069 # Not in pecl
10281070 - name : Setup mongodb
1071+ shell : bash
10291072 run : |
10301073 curl -sLO https://github.com/mongodb/mongo-php-driver/releases/download/1.17.2/php_mongodb-1.17.2-8.3-nts-x64.zip
10311074 unzip -q php_mongodb-1.17.2-8.3-nts-x64.zip php_mongodb.dll
1032- mv php_mongodb.dll C:\ tools\ php\ ext
1033- echo "extension=php_mongodb.dll" >> C:\ tools\ php\ php.ini
1075+ mv php_mongodb.dll C:/ tools/ php/ ext
1076+ echo "extension=php_mongodb.dll" >> C:/ tools/ php/ php.ini
10341077 - name : Get composer cache directory
10351078 id : composercache
1036- run : echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
10371079 shell : bash
1080+ run : echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
10381081 - name : Cache dependencies
10391082 uses : actions/cache@v4
10401083 with :
@@ -1043,18 +1086,21 @@ jobs:
10431086 restore-keys : ${{ runner.os }}-composer-
10441087 - name : Keep windows path
10451088 id : get-cwd
1089+ shell : bash
10461090 run : |
10471091 cwd=$(php -r 'echo(str_replace("\\", "\\\\", $_SERVER["argv"][1]));' '${{ github.workspace }}')
10481092 echo cwd=$cwd >> $GITHUB_OUTPUT
1049- shell : bash
10501093 - name : Update project dependencies
1094+ shell : bash
10511095 run : |
10521096 composer global require soyuka/pmu
10531097 composer global config allow-plugins.soyuka/pmu true --no-interaction
10541098 composer global link . --working-directory='${{ steps.get-cwd.outputs.cwd }}'
10551099 - name : Clear test app cache
1100+ shell : bash
10561101 run : tests/Fixtures/app/console cache:clear --ansi
10571102 - name : Run Behat tests
1103+ shell : bash
10581104 run : vendor/bin/behat --out=std --format=progress --profile=default --no-interaction
10591105
10601106 phpunit-symfony-lowest :
0 commit comments