|
| 1 | +name: tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + pull_request: |
| 6 | + |
| 7 | +jobs: |
| 8 | + latest: |
| 9 | + name: PHP ${{ matrix.php }} Latest |
| 10 | + runs-on: ubuntu-latest |
| 11 | + strategy: |
| 12 | + matrix: |
| 13 | + php: ['7.1', '7.2', '7.3', '7.4', '8.0'] |
| 14 | + |
| 15 | + steps: |
| 16 | + - name: Checkout code |
| 17 | + uses: actions/checkout@v2 |
| 18 | + |
| 19 | + - name: Setup PHP |
| 20 | + uses: shivammathur/setup-php@v2 |
| 21 | + with: |
| 22 | + php-version: ${{ matrix.php }} |
| 23 | + tools: composer:v2 |
| 24 | + coverage: none |
| 25 | + |
| 26 | + - name: Install PHP 7 dependencies |
| 27 | + run: composer update --prefer-dist --no-interaction --no-progress |
| 28 | + if: "matrix.php != '8.0'" |
| 29 | + |
| 30 | + - name: Install PHP 8 dependencies |
| 31 | + run: | |
| 32 | + composer require "phpdocumentor/reflection-docblock:^5.2@dev" --no-interaction --no-update |
| 33 | + composer update --prefer-dist --prefer-stable --no-interaction --no-progress --ignore-platform-req=php |
| 34 | + if: "matrix.php == '8.0'" |
| 35 | + |
| 36 | + - name: Execute tests |
| 37 | + run: composer test |
| 38 | + |
| 39 | + lowest: |
| 40 | + name: PHP ${{ matrix.php }} Lowest |
| 41 | + runs-on: ubuntu-latest |
| 42 | + strategy: |
| 43 | + matrix: |
| 44 | + php: ['7.1', '7.2', '7.3', '7.4'] |
| 45 | + |
| 46 | + steps: |
| 47 | + - name: Checkout code |
| 48 | + uses: actions/checkout@v2 |
| 49 | + |
| 50 | + - name: Setup PHP |
| 51 | + uses: shivammathur/setup-php@v2 |
| 52 | + with: |
| 53 | + php-version: ${{ matrix.php }} |
| 54 | + tools: composer:v2 |
| 55 | + coverage: none |
| 56 | + |
| 57 | + - name: Install dependencies |
| 58 | + run: | |
| 59 | + composer require "sebastian/comparator:^3.0.2" --no-interaction --no-update |
| 60 | + composer update --prefer-dist --prefer-stable --prefer-lowest --no-interaction --no-progress |
| 61 | +
|
| 62 | + - name: Execute tests |
| 63 | + run: composer test |
| 64 | + |
| 65 | + coverage: |
| 66 | + name: Code Coverage |
| 67 | + runs-on: ubuntu-latest |
| 68 | + |
| 69 | + steps: |
| 70 | + - name: Checkout code |
| 71 | + uses: actions/checkout@v2 |
| 72 | + |
| 73 | + - name: Setup PHP |
| 74 | + uses: shivammathur/setup-php@v2 |
| 75 | + with: |
| 76 | + php-version: 7.4 |
| 77 | + tools: composer:v2 |
| 78 | + coverage: xdebug |
| 79 | + |
| 80 | + - name: Install dependencies |
| 81 | + run: | |
| 82 | + composer require "friends-of-phpspec/phpspec-code-coverage:^4.3.2" --no-interaction --no-update |
| 83 | + composer update --prefer-dist --no-interaction --no-progress |
| 84 | +
|
| 85 | + - name: Execute tests |
| 86 | + run: composer test-ci |
| 87 | + |
| 88 | + - name: Upload coverage |
| 89 | + run: | |
| 90 | + wget https://scrutinizer-ci.com/ocular.phar |
| 91 | + php ocular.phar code-coverage:upload --format=php-clover build/coverage.xml |
0 commit comments