1
0
mirror of https://github.com/Ne-Lexa/php-zip.git synced 2025-08-02 13:37:25 +02:00

update github actions build

This commit is contained in:
Ne-Lexa
2021-02-22 20:24:13 +03:00
parent ae04b357fc
commit f799eca6de
2 changed files with 61 additions and 41 deletions

View File

@@ -9,8 +9,9 @@ jobs:
name: PHP ${{ matrix.php }} Test on ${{ matrix.os }} name: PHP ${{ matrix.php }} Test on ${{ matrix.os }}
env: env:
extensions: bz2, dom, iconv, fileinfo, openssl, xml, zlib extensions: bz2, dom, iconv, fileinfo, openssl, xml, zlib
key: cache-v1 key: cache-v1
PHPUNIT_COVERAGE: 0
strategy: strategy:
matrix: matrix:
@@ -48,6 +49,11 @@ jobs:
if: matrix.os == 'ubuntu-latest' if: matrix.os == 'ubuntu-latest'
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
-
name: Set coverage args
if: matrix.os == 'ubuntu-latest' && matrix.php == '8.0'
run: echo "PHPUNIT_COVERAGE=1" >> $GITHUB_ENV
- -
name: Determine composer cache directory on Windows name: Determine composer cache directory on Windows
if: matrix.os == 'windows-latest' if: matrix.os == 'windows-latest'
@@ -83,4 +89,18 @@ jobs:
- -
name: Run tests with phpunit name: Run tests with phpunit
run: vendor/bin/phpunit --colors=always if: env.PHPUNIT_COVERAGE == 0
run: vendor/bin/phpunit -v
-
name: Run tests with phpunit and coverage
if: env.PHPUNIT_COVERAGE == 1
run: vendor/bin/phpunit -v --coverage-clover=coverage.clover
-
name: Upload code coverage scrutinizer
if: env.PHPUNIT_COVERAGE == 1
run: |
wget https://scrutinizer-ci.com/ocular.phar
php ocular.phar code-coverage:upload --format=php-clover coverage.clover

View File

@@ -1,43 +1,43 @@
filter:
paths: ["src/*"]
excluded_paths: ["vendor/*", "tests/*"]
checks: checks:
php: php: true
code_rating: true
duplication: true filter:
paths: [ "src/*" ]
excluded_paths: [ "vendor/*", "tests/*" ]
tools: tools:
external_code_coverage: false external_code_coverage: false
build: build:
environment: environment:
php: php:
version: 7.4 version: 8.0
pecl_extensions: pecl_extensions:
- zip - zip
mysql: false mysql: false
node: false node: false
postgresql: false postgresql: false
mongodb: false mongodb: false
elasticsearch: false elasticsearch: false
redis: false redis: false
memcached: false memcached: false
neo4j: false neo4j: false
rabbitmq: false rabbitmq: false
nodes: nodes:
analysis: analysis:
tests: environment:
override: php: 8.0
- php-scrutinizer-run tests:
dependencies: override:
before: - php-scrutinizer-run
- composer self-update dependencies:
- composer update --no-interaction --prefer-dist --no-progress before:
tests: - composer self-update
before: - composer update --no-interaction --prefer-dist --no-progress
- tests:
command: composer test:coverage before:
coverage: -
file: 'build/logs/clover.xml' command: composer test:coverage
format: 'clover' coverage:
file: 'build/logs/clover.xml'
format: 'clover'