Skip to content

Instantly share code, notes, and snippets.

@andrey-helldar
Last active April 8, 2020 15:29
Show Gist options
  • Save andrey-helldar/03a0b18a07ccf15322ac4d40415be8bc to your computer and use it in GitHub Desktop.
Save andrey-helldar/03a0b18a07ccf15322ac4d40415be8bc to your computer and use it in GitHub Desktop.
Настройки окружения плагинов
name: phpunit
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php: [7.2, 7.3, 7.4]
dependency-version: [prefer-lowest, prefer-stable]
name: PHP ${{ matrix.php }} - ${{ matrix.dependency-version }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v1
with:
php-version: ${{ matrix.php }}
extensions: curl, mbstring, zip, pcntl, pdo, pdo_sqlite, iconv
coverage: xdebug
- name: Composer self update
run: |
composer self-update
composer global require hirak/prestissimo --no-plugins
- name: Validate composer.json and composer.lock
run: composer validate
- name: Install dependencies
run: composer update --${{ matrix.dependency-version }} --prefer-dist --no-progress --no-interaction --no-suggest
- name: Execute tests
run: |
mkdir -p build/logs
vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover
- name: Scrutinizer CI
run: |
wget https://scrutinizer-ci.com/ocular.phar
php ocular.phar code-coverage:upload --format=php-clover coverage.clover
preset: psr12
enabled:
- align_double_arrow
- align_equals
- align_phpdoc
- alpha_ordered_imports
- binary_operator_spaces
- blank_line_before_continue
- blank_line_before_declare
- blank_line_before_return
- blank_line_before_throw
- blank_line_before_try
- cast_spaces
- combine_consecutive_issets
- const_separation
- const_visibility_required
- dir_constant
- fully_qualified_strict_types
- logical_operators
- lowercase_cast
- lowercase_static_reference
- method_separation
- no_alias_functions
- no_blank_lines_after_phpdoc
- no_blank_lines_between_traits
- no_empty_comment
- no_empty_phpdoc
- no_extra_block_blank_lines
- no_extra_consecutive_blank_lines
- no_short_bool_cast
- no_trailing_comma_in_singleline_array
- no_unneeded_control_parentheses
- no_unused_imports
- ordered_class_elements
- php_unit_construct
- php_unit_fqcn_annotation
- phpdoc_indent
- phpdoc_inline_tag
- phpdoc_link_to_see
- phpdoc_no_access
- phpdoc_no_empty_return
- phpdoc_no_package
- phpdoc_no_useless_inheritdoc
- phpdoc_order
- phpdoc_property
- phpdoc_return_self_reference
- phpdoc_scalar
- phpdoc_separation
- phpdoc_summary
- phpdoc_to_comment
- phpdoc_trim
- phpdoc_type_to_var
- phpdoc_types
- phpdoc_types_order
- phpdoc_var_without_name
- property_separation
- self_accessor
- self_static_accessor
- short_array_syntax
- short_list_syntax
- short_scalar_cast
- single_blank_line_before_namespace
- single_line_class_definition
- single_line_throw
- single_quote
- space_after_semicolon
- standardize_not_equals
- ternary_operator_spaces
- ternary_to_null_coalescing
- trailing_comma_in_multiline_array
- trim_array_spaces
dist: bionic
language: php
env:
global:
- SETUP=stable
matrix:
fast_finish: true
include:
- php: 7.2
- php: 7.2
env: SETUP=lowest
- php: 7.3
- php: 7.3
env: SETUP=lowest
- php: 7.4
- php: 7.4
env: SETUP=lowest
- php: 7.4
env: SETUP=lint
name: "Lint code"
cache:
directories:
- $HOME/.composer/cache
before_install:
- travis_retry composer self-update
install:
- if [[ $SETUP = 'stable' ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-stable --no-suggest; fi
- if [[ $SETUP = 'lowest' ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-lowest --no-suggest; fi
- if [[ $SETUP = 'lint' ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-stable --no-suggest; travis_retry vendor/bin/phpstan; fi
script:
- mkdir -p build/logs
- vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover
after_script:
- wget https://scrutinizer-ci.com/ocular.phar; fi
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment