@@ -863,3 +863,150 @@ jobs:
863
863
run : tests/Fixtures/app/console cache:clear --ansi
864
864
- name : Run Behat tests
865
865
run : vendor/bin/behat --out=std --format=progress --profile=default --no-interaction
866
+
867
+ phpunit_legacy :
868
+ name : PHPUnit Legacy event listeners (PHP ${{ matrix.php }})
869
+ env :
870
+ EVENT_LISTENERS_BACKWARD_COMPATIBILITY_LAYER : 1
871
+ runs-on : ubuntu-latest
872
+ timeout-minutes : 20
873
+ strategy :
874
+ matrix :
875
+ php :
876
+ - ' 8.2'
877
+ include :
878
+ - php : ' 8.2'
879
+ coverage : true
880
+ fail-fast : false
881
+ steps :
882
+ - name : Checkout
883
+ uses : actions/checkout@v3
884
+ - name : Setup PHP
885
+ uses : shivammathur/setup-php@v2
886
+ with :
887
+ php-version : ${{ matrix.php }}
888
+ tools : pecl, composer
889
+ extensions : intl, bcmath, curl, openssl, mbstring, pdo_sqlite
890
+ coverage : pcov
891
+ ini-values : memory_limit=-1
892
+ - name : Get composer cache directory
893
+ id : composercache
894
+ run : echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
895
+ - name : Cache dependencies
896
+ uses : actions/cache@v3
897
+ with :
898
+ path : ${{ steps.composercache.outputs.dir }}
899
+ key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
900
+ restore-keys : ${{ runner.os }}-composer-
901
+ - name : Enable code coverage
902
+ if : matrix.coverage
903
+ run : echo "COVERAGE=1" >> $GITHUB_ENV
904
+ - name : Update project dependencies
905
+ run : composer update --no-interaction --no-progress --ansi
906
+ - name : Install PHPUnit
907
+ run : vendor/bin/simple-phpunit --version
908
+ - name : Clear test app cache
909
+ run : tests/Fixtures/app/console cache:clear --ansi
910
+ - name : Run PHPUnit tests
911
+ run : |
912
+ mkdir -p build/logs/phpunit
913
+ if [ "$COVERAGE" = '1' ]; then
914
+ vendor/bin/simple-phpunit --log-junit build/logs/phpunit/junit.xml --coverage-clover build/logs/phpunit/clover.xml
915
+ else
916
+ vendor/bin/simple-phpunit --log-junit build/logs/phpunit/junit.xml
917
+ fi
918
+ - name : Upload test artifacts
919
+ if : always()
920
+ uses : actions/upload-artifact@v3
921
+ with :
922
+ name : phpunit-logs-php${{ matrix.php }}
923
+ path : build/logs/phpunit
924
+ continue-on-error : true
925
+ - name : Upload coverage results to Codecov
926
+ if : matrix.coverage
927
+ uses : codecov/codecov-action@v3
928
+ with :
929
+ directory : build/logs/phpunit
930
+ name : phpunit-php${{ matrix.php }}
931
+ flags : phpunit
932
+ fail_ci_if_error : true
933
+ continue-on-error : true
934
+ - name : Upload coverage results to Coveralls
935
+ if : matrix.coverage
936
+ env :
937
+ COVERALLS_REPO_TOKEN : ${{ secrets.GITHUB_TOKEN }}
938
+ run : |
939
+ composer global require --prefer-dist --no-interaction --no-progress --ansi php-coveralls/php-coveralls
940
+ export PATH="$PATH:$HOME/.composer/vendor/bin"
941
+ php-coveralls --coverage_clover=build/logs/phpunit/clover.xml
942
+ continue-on-error : true
943
+
944
+ behat_legacy :
945
+ name : Behat Legacy event listeners (PHP ${{ matrix.php }})
946
+ env :
947
+ EVENT_LISTENERS_BACKWARD_COMPATIBILITY_LAYER : 1
948
+ runs-on : ubuntu-latest
949
+ timeout-minutes : 20
950
+ strategy :
951
+ matrix :
952
+ php :
953
+ - ' 8.2'
954
+ fail-fast : false
955
+ steps :
956
+ - name : Checkout
957
+ uses : actions/checkout@v3
958
+ - name : Setup PHP
959
+ uses : shivammathur/setup-php@v2
960
+ with :
961
+ php-version : ${{ matrix.php }}
962
+ tools : pecl, composer
963
+ extensions : intl, bcmath, curl, openssl, mbstring, pdo_sqlite
964
+ coverage : pcov
965
+ ini-values : memory_limit=-1
966
+ - name : Get composer cache directory
967
+ id : composercache
968
+ run : echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
969
+ - name : Cache dependencies
970
+ uses : actions/cache@v3
971
+ with :
972
+ path : ${{ steps.composercache.outputs.dir }}
973
+ key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
974
+ restore-keys : ${{ runner.os }}-composer-
975
+ - name : Update project dependencies
976
+ run : composer update --no-interaction --no-progress --ansi
977
+ - name : Install PHPUnit
978
+ run : vendor/bin/simple-phpunit --version
979
+ - name : Clear test app cache
980
+ run : tests/Fixtures/app/console cache:clear --ansi
981
+ - name : Run Behat tests (PHP 8)
982
+ run : |
983
+ mkdir -p build/logs/behat
984
+ vendor/bin/behat --out=std --format=progress --format=junit --out=build/logs/behat/junit --profile=legacy --no-interaction
985
+ - name : Upload test artifacts
986
+ if : always()
987
+ uses : actions/upload-artifact@v3
988
+ with :
989
+ name : behat-logs-php${{ matrix.php }}
990
+ path : build/logs/behat
991
+ continue-on-error : true
992
+ - name : Export OpenAPI documents
993
+ run : |
994
+ mkdir -p build/out/openapi
995
+ tests/Fixtures/app/console api:openapi:export -o build/out/openapi/openapi_v3.json
996
+ tests/Fixtures/app/console api:openapi:export --yaml -o build/out/openapi/openapi_v3.yaml
997
+ - name : Setup node
998
+ uses : actions/setup-node@v3
999
+ with :
1000
+ node-version : ' 14'
1001
+ - name : Validate OpenAPI documents
1002
+ run : |
1003
+ npx git+https://github.com/soyuka/swagger-cli#master validate build/out/openapi/openapi_v3.json
1004
+ npx git+https://github.com/soyuka/swagger-cli#master validate build/out/openapi/openapi_v3.yaml
1005
+ - name : Upload OpenAPI artifacts
1006
+ if : always()
1007
+ uses : actions/upload-artifact@v3
1008
+ with :
1009
+ name : openapi-docs-php${{ matrix.php }}
1010
+ path : build/out/openapi
1011
+ continue-on-error : true
1012
+
0 commit comments