Skip to content

Commit da42b7f

Browse files
committed
use xdebug instead of pcov
1 parent 420423d commit da42b7f

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

.github/workflows/test.Dockerfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ ENV COMPOSER_CACHE_DIR=/.composer
1313
# install PHP extension pcov
1414
RUN if [[ "${CODE_COVERAGE}" == "true" ]] ; \
1515
then apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \
16-
&& mkdir -p /usr/src/php/ext/pcov && curl -fsSL https://pecl.php.net/get/pcov | tar xvz -C /usr/src/php/ext/pcov --strip 1 \
17-
&& docker-php-ext-install pcov \
18-
&& docker-php-ext-enable pcov \
19-
&& rm -Rf /usr/src/php/ext/pcov \
16+
&& pecl install xdebug \
17+
&& docker-php-ext-enable xdebug \
2018
&& apk del --no-cache .build-deps
2119

.github/workflows/test.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,21 +67,21 @@ jobs:
6767
uses: actions/cache@v2
6868
with:
6969
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' || '' }}
7171

7272
- name: Load Docker Image
7373
if: steps.cache-docker-image.outputs.cache-hit == 'true'
7474
run: docker load --input /tmp/docker-image.tar
7575

7676
- name: Build Docker Image
7777
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 }}' .
7979

8080
- name: Cache Composer Cache Files
8181
uses: actions/cache@v2
8282
with:
8383
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' || '' }}
8585
restore-keys: |
8686
cache-composer-cache-files-
8787
@@ -90,12 +90,12 @@ jobs:
9090
if [ "${{ matrix.RUN_PHPSTAN }}" != "true" ]; then composer remove --dev phpstan/phpstan --no-update --no-interaction; fi
9191
if [ "${{ matrix.RUN_PSALM }}" != "true" ]; then composer remove --dev vimeo/psalm --no-update --no-interaction; fi
9292
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 }}
9494
9595
- name: Run Unit Test
9696
run: |
9797
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
9999
else
100100
docker run --rm -u "$(id -u):$(id -g)" -v "$(pwd):/workdir" 'test:${{ matrix.PHP_VERSION }}' php -d 'zend.assertions=1' ./vendor/bin/phpunit
101101
fi
@@ -109,16 +109,16 @@ jobs:
109109

110110
- name: Run PHPStan
111111
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/
113113

114114
- name: Run psalm
115115
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
117117

118118
- name: Run benchmark
119119
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
121121

122122
- name: Export Docker Image
123123
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

Comments
 (0)