File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,14 +8,3 @@ RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local
88ENV COMPOSER_ALLOW_SUPERUSER=1
99ENV COMPOSER_HTACCESS_PROTECT=0
1010ENV COMPOSER_CACHE_DIR=/.composer-cache-dir
11-
12- # install PHP extension pcov
13- ARG CODE_COVERAGE
14- RUN if [[ "${CODE_COVERAGE}" == "true" ]] ; then \
15- 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 \
20- && apk del --no-cache .build-deps \
21- ; fi
Original file line number Diff line number Diff line change @@ -14,27 +14,21 @@ jobs:
1414 matrix :
1515 include :
1616 - PHP_VERSION : ' 7.1'
17- CODE_COVERAGE : ' false'
1817 RUN_PHPSTAN : ' false'
1918 RUN_PSALM : ' false'
2019 - PHP_VERSION : ' 7.2'
21- CODE_COVERAGE : ' true'
2220 RUN_PHPSTAN : ' false'
2321 RUN_PSALM : ' false'
2422 - PHP_VERSION : ' 7.3'
25- CODE_COVERAGE : ' true'
2623 RUN_PHPSTAN : ' false'
2724 RUN_PSALM : ' false'
2825 - PHP_VERSION : ' 7.4'
29- CODE_COVERAGE : ' true'
3026 RUN_PHPSTAN : ' true'
3127 RUN_PSALM : ' true'
3228 - PHP_VERSION : ' 8.0'
33- CODE_COVERAGE : ' true'
3429 RUN_PHPSTAN : ' true'
3530 RUN_PSALM : ' true'
3631 - PHP_VERSION : ' 8.1'
37- CODE_COVERAGE : ' true'
3832 RUN_PHPSTAN : ' false'
3933 RUN_PSALM : ' false'
4034
@@ -46,15 +40,15 @@ jobs:
4640 uses : actions/cache@v5
4741 with :
4842 path : /tmp/docker-cache-image.tar
49- key : docker-cache-image:${{ matrix.PHP_VERSION }}:${{ matrix.CODE_COVERAGE }}
43+ key : docker-cache-image:${{ matrix.PHP_VERSION }}
5044
5145 - name : Load Docker Image
5246 if : steps.docker-cache-image.outputs.cache-hit == 'true'
5347 run : docker load --input /tmp/docker-cache-image.tar
5448
5549 - name : Build Docker Image
5650 if : steps.docker-cache-image.outputs.cache-hit != 'true'
57- run : docker build -f .github/workflows/test.Dockerfile -t 'test:${{ matrix.PHP_VERSION }}' --build-arg 'PHP_VERSION=${{ matrix.PHP_VERSION }}' --build-arg 'CODE_COVERAGE=${{ matrix.CODE_COVERAGE }}' .
51+ run : docker build -f .github/workflows/test.Dockerfile -t 'test:${{ matrix.PHP_VERSION }}' --build-arg 'PHP_VERSION=${{ matrix.PHP_VERSION }}' .
5852
5953 - name : Cache Composer Cache Dir
6054 uses : actions/cache@v5
7670
7771 - name : Run Unit Test
7872 run : |
79- if [ "${{ matrix.CODE_COVERAGE }}" == "true" ]; then
80- 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
81- else
82- docker run --rm -u "$(id -u):$(id -g)" -v "$(pwd):/workdir" 'test:${{ matrix.PHP_VERSION }}' php -d 'zend.assertions=1' ./vendor/bin/phpunit
83- fi
84-
85- - name : Upload Codecov Report
86- uses : codecov/codecov-action@v1
87- if : ${{ matrix.CODE_COVERAGE == 'true' }}
88- with :
89- file : .clover.xml
73+ docker run --rm -u "$(id -u):$(id -g)" -v "$(pwd):/workdir" 'test:${{ matrix.PHP_VERSION }}' php -d 'zend.assertions=1' ./vendor/bin/phpunit
9074
9175 - name : Run PHPStan
9276 if : ${{ matrix.RUN_PHPSTAN == 'true' }}
You can’t perform that action at this time.
0 commit comments