Skip to content

Commit 0d74161

Browse files
committed
Install pcov only if needed
1 parent 8b9721e commit 0d74161

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

.github/workflows/test.Dockerfile

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,3 @@ RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local
88
ENV COMPOSER_ALLOW_SUPERUSER=1
99
ENV COMPOSER_HTACCESS_PROTECT=0
1010
ENV COMPOSER_CACHE_DIR=/.composer
11-
12-
# install PHP extension pcov
13-
RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \
14-
&& 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 \
15-
&& docker-php-ext-install pcov \
16-
&& docker-php-ext-enable pcov \
17-
&& rm -Rf /usr/src/php/ext/pcov \
18-
&& apk del --no-cache .build-deps

.github/workflows/test.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,12 @@ jobs:
9595
- name: Run Unit Test
9696
run: |
9797
if [ "${{ matrix.CODE_COVERAGE }}" == "true" ]; then
98-
docker run --rm -u "$(id -u):$(id -g)" -v "$(pwd):/workdir" 'test:${{ matrix.PHP_VERSION }}' 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 }}' \
99+
apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \
100+
&& 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 \
101+
&& docker-php-ext-install pcov \
102+
&& docker-php-ext-enable pcov \
103+
&& php -d 'zend.assertions=1' -d 'pcov.enabled=1' ./vendor/bin/phpunit --coverage-clover=.clover.xml
99104
else
100105
docker run --rm -u "$(id -u):$(id -g)" -v "$(pwd):/workdir" 'test:${{ matrix.PHP_VERSION }}' php -d 'zend.assertions=1' ./vendor/bin/phpunit
101106
fi

0 commit comments

Comments
 (0)