|
| 1 | +name: PHPPresentation |
| 2 | +on: [push, pull_request] |
| 3 | +jobs: |
| 4 | + php-cs-fixer: |
| 5 | + name: PHP CS Fixer |
| 6 | + runs-on: ubuntu-latest |
| 7 | + steps: |
| 8 | + - name: Setup PHP |
| 9 | + uses: shivammathur/setup-php@v2 |
| 10 | + with: |
| 11 | + php-version: '7.4' |
| 12 | + extensions: mbstring, intl, gd, xml, dom, json, fileinfo, curl, zip, iconv |
| 13 | + - uses: actions/checkout@v2 |
| 14 | + |
| 15 | + - name: Validate composer config |
| 16 | + run: composer validate --strict |
| 17 | + |
| 18 | + - name: Composer Install |
| 19 | + run: composer global require friendsofphp/php-cs-fixer |
| 20 | + |
| 21 | + - name: Add environment path |
| 22 | + run: export PATH="$PATH:$HOME/.composer/vendor/bin" |
| 23 | + |
| 24 | + - name: Run PHPCSFixer |
| 25 | + run: php-cs-fixer fix --dry-run --diff |
| 26 | + |
| 27 | + phpmd: |
| 28 | + name: PHP Mess Detector |
| 29 | + runs-on: ubuntu-latest |
| 30 | + steps: |
| 31 | + - name: Setup PHP |
| 32 | + uses: shivammathur/setup-php@v2 |
| 33 | + with: |
| 34 | + php-version: '7.4' |
| 35 | + extensions: gd, xml, zip |
| 36 | + - uses: actions/checkout@v2 |
| 37 | + |
| 38 | + - name: Composer Install |
| 39 | + run: composer install --ansi --prefer-dist --no-interaction --no-progress |
| 40 | + |
| 41 | + - name: Run phpmd |
| 42 | + run: ./vendor/bin/phpmd src/,tests/ text ./phpmd.xml.dist |
| 43 | + |
| 44 | + phpstan: |
| 45 | + name: PHP Static Analysis |
| 46 | + runs-on: ubuntu-latest |
| 47 | + strategy: |
| 48 | + fail-fast: false |
| 49 | + matrix: |
| 50 | + php: ['7.1', '7.2', '7.3', '7.4', '8.0'] #, '8.1' |
| 51 | + steps: |
| 52 | + - name: Setup PHP |
| 53 | + uses: shivammathur/setup-php@v2 |
| 54 | + with: |
| 55 | + php-version: ${{ matrix.php }} |
| 56 | + extensions: gd, xml, zip |
| 57 | + - uses: actions/checkout@v2 |
| 58 | + |
| 59 | + - name: Composer Install |
| 60 | + run: composer install --ansi --prefer-dist --no-interaction --no-progress |
| 61 | + |
| 62 | + - name: Run phpstan |
| 63 | + run: ./vendor/bin/phpstan analyse -c phpstan.neon.dist |
| 64 | + |
| 65 | + phpunit: |
| 66 | + name: PHPUnit |
| 67 | + runs-on: ubuntu-latest |
| 68 | + strategy: |
| 69 | + fail-fast: false |
| 70 | + matrix: |
| 71 | + php: ['7.1', '7.2', '7.3', '7.4', '8.0'] #, '8.1' |
| 72 | + steps: |
| 73 | + - name: Setup PHP |
| 74 | + uses: shivammathur/setup-php@v2 |
| 75 | + with: |
| 76 | + php-version: ${{ matrix.php }} |
| 77 | + extensions: gd, xml, zip |
| 78 | + coverage: xdebug |
| 79 | + |
| 80 | + - name: Generate Locale (for tests) |
| 81 | + run: sudo locale-gen de_DE.UTF-8 |
| 82 | + |
| 83 | + - uses: actions/checkout@v2 |
| 84 | + |
| 85 | + - name: Composer Install |
| 86 | + run: composer install --ansi --prefer-dist --no-interaction --no-progress |
| 87 | + |
| 88 | + - name: Run phpunit |
| 89 | + run: ./vendor/bin/phpunit -c phpunit.xml.dist --coverage-clover build/clover.xml |
| 90 | + |
| 91 | + - name: Upload coverage results to Coveralls |
| 92 | + if: matrix.php == '7.3' |
| 93 | + env: |
| 94 | + COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 95 | + run: | |
| 96 | + wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.4.3/php-coveralls.phar |
| 97 | + chmod +x php-coveralls.phar |
| 98 | + php php-coveralls.phar --coverage_clover=build/clover.xml --json_path=build/coveralls-upload.json -vvv |
0 commit comments