@@ -67,21 +67,21 @@ jobs:
67
67
uses : actions/cache@v2
68
68
with :
69
69
path : /tmp/docker-image.tar
70
- key : cache-docker-image-test:${{ matrix.PHP_VERSION }}${{ matrix.CODE_COVERAGE == 'true' && '-pcov ' || '' }}
70
+ key : cache-docker-image-test:${{ matrix.PHP_VERSION }}${{ matrix.CODE_COVERAGE == 'true' && '-xdebug ' || '' }}
71
71
72
72
- name : Load Docker Image
73
73
if : steps.cache-docker-image.outputs.cache-hit == 'true'
74
74
run : docker load --input /tmp/docker-image.tar
75
75
76
76
- name : Build Docker Image
77
77
if : steps.cache-docker-image.outputs.cache-hit != 'true'
78
- run : docker build -f .github/workflows/test.Dockerfile -t 'test:${{ matrix.PHP_VERSION }}${{ matrix.CODE_COVERAGE == 'true' && '-pcov ' || '' }}' --build-arg 'PHP_VERSION=${{ matrix.PHP_VERSION }}' --build-arg 'CODE_COVERAGE=${{ matrix.CODE_COVERAGE }}' .
78
+ run : docker build -f .github/workflows/test.Dockerfile -t 'test:${{ matrix.PHP_VERSION }}${{ matrix.CODE_COVERAGE == 'true' && '-xdebug ' || '' }}' --build-arg 'PHP_VERSION=${{ matrix.PHP_VERSION }}' --build-arg 'CODE_COVERAGE=${{ matrix.CODE_COVERAGE }}' .
79
79
80
80
- name : Cache Composer Cache Files
81
81
uses : actions/cache@v2
82
82
with :
83
83
path : /tmp/composer-cache-files
84
- key : cache-composer-cache-files-${{ matrix.PHP_VERSION }}${{ matrix.CODE_COVERAGE == 'true' && '-pcov ' || '' }}
84
+ key : cache-composer-cache-files-${{ matrix.PHP_VERSION }}${{ matrix.CODE_COVERAGE == 'true' && '-xdebug ' || '' }}
85
85
restore-keys : |
86
86
cache-composer-cache-files-
87
87
@@ -90,12 +90,12 @@ jobs:
90
90
if [ "${{ matrix.RUN_PHPSTAN }}" != "true" ]; then composer remove --dev phpstan/phpstan --no-update --no-interaction; fi
91
91
if [ "${{ matrix.RUN_PSALM }}" != "true" ]; then composer remove --dev vimeo/psalm --no-update --no-interaction; fi
92
92
if [ "${{ matrix.RUN_BENCHMARK }}" != "true" ]; then composer remove --dev phpbench/phpbench --no-update --no-interaction; fi
93
- docker run --rm -u "$(id -u):$(id -g)" -v "$(pwd):/workdir" -v '/tmp/composer-cache-files:/.composer' 'test:${{ matrix.PHP_VERSION }}' composer install --no-interaction --no-progress --prefer-dist ${{ matrix.COMPOSER_EXTRA_ARGS }}
93
+ docker run --rm -u "$(id -u):$(id -g)" -v "$(pwd):/workdir" -v '/tmp/composer-cache-files:/.composer' 'test:${{ matrix.PHP_VERSION }}${{ matrix.CODE_COVERAGE == 'true' && '-xdebug' || '' }} ' composer install --no-interaction --no-progress --prefer-dist ${{ matrix.COMPOSER_EXTRA_ARGS }}
94
94
95
95
- name : Run Unit Test
96
96
run : |
97
97
if [ "${{ matrix.CODE_COVERAGE }}" == "true" ]; then
98
- docker run --rm -v "$(pwd):/workdir" 'test:${{ matrix.PHP_VERSION }}-pcov ' php -d 'zend.assertions=1' -d 'pcov.enabled =1' ./vendor/bin/phpunit --coverage-clover=.clover.xml
98
+ docker run --rm -u "$(id -u):$(id -g)" - v "$(pwd):/workdir" 'test:${{ matrix.PHP_VERSION }}-xdebug ' php -d 'zend.assertions=1' ./vendor/bin/phpunit --coverage-clover=.clover.xml
99
99
else
100
100
docker run --rm -u "$(id -u):$(id -g)" -v "$(pwd):/workdir" 'test:${{ matrix.PHP_VERSION }}' php -d 'zend.assertions=1' ./vendor/bin/phpunit
101
101
fi
@@ -109,16 +109,16 @@ jobs:
109
109
110
110
- name : Run PHPStan
111
111
if : ${{ matrix.RUN_PHPSTAN }}
112
- run : docker run --rm -u "$(id -u):$(id -g)" -v "$(pwd):/workdir" 'test:${{ matrix.PHP_VERSION }}${{ matrix.CODE_COVERAGE == 'true' && '-pcov ' || '' }}' php -d 'memory_limit=2G' ./vendor/bin/phpstan analyse --level max src/ tests/
112
+ run : docker run --rm -u "$(id -u):$(id -g)" -v "$(pwd):/workdir" 'test:${{ matrix.PHP_VERSION }}${{ matrix.CODE_COVERAGE == 'true' && '-xdebug ' || '' }}' php -d 'memory_limit=2G' ./vendor/bin/phpstan analyse --level max src/ tests/
113
113
114
114
- name : Run psalm
115
115
if : ${{ matrix.RUN_PSALM }}
116
- run : mkdir -p "$HOME/.cache/psalm" && docker run --rm -u "$(id -u):$(id -g)" -v "$(pwd):/workdir" -v "$HOME/.cache/psalm:/.cache/psalm" 'test:${{ matrix.PHP_VERSION }}${{ matrix.CODE_COVERAGE == 'true' && '-pcov ' || '' }}' php ./vendor/bin/psalm
116
+ run : mkdir -p "$HOME/.cache/psalm" && docker run --rm -u "$(id -u):$(id -g)" -v "$(pwd):/workdir" -v "$HOME/.cache/psalm:/.cache/psalm" 'test:${{ matrix.PHP_VERSION }}${{ matrix.CODE_COVERAGE == 'true' && '-xdebug ' || '' }}' php ./vendor/bin/psalm
117
117
118
118
- name : Run benchmark
119
119
if : ${{ matrix.RUN_BENCHMARK }}
120
- run : docker run --rm -u "$(id -u):$(id -g)" -v "$(pwd):/workdir" 'test:${{ matrix.PHP_VERSION }}${{ matrix.CODE_COVERAGE == 'true' && '-pcov ' || '' }}' php -d 'zend.assertions=-1' ./vendor/bin/phpbench run --no-interaction --revs=1 --retry-threshold=100 --progress=none
120
+ run : docker run --rm -u "$(id -u):$(id -g)" -v "$(pwd):/workdir" 'test:${{ matrix.PHP_VERSION }}${{ matrix.CODE_COVERAGE == 'true' && '-xdebug ' || '' }}' php -d 'zend.assertions=-1' ./vendor/bin/phpbench run --no-interaction --revs=1 --retry-threshold=100 --progress=none
121
121
122
122
- name : Export Docker Image
123
123
if : steps.cache-docker-image.outputs.cache-hit != 'true'
124
- run : docker save --output /tmp/docker-image.tar 'test:${{ matrix.PHP_VERSION }}${{ matrix.CODE_COVERAGE == 'true' && '-pcov ' || '' }}'
124
+ run : docker save --output /tmp/docker-image.tar 'test:${{ matrix.PHP_VERSION }}${{ matrix.CODE_COVERAGE == 'true' && '-xdebug ' || '' }}'
0 commit comments