|
36 | 36 | - uses: gaurav-nelson/github-action-markdown-link-check@v1
|
37 | 37 | with:
|
38 | 38 | use-verbose-mode: 'yes'
|
| 39 | + |
| 40 | + unit-tests: |
| 41 | + name: "Unit tests" |
| 42 | + runs-on: ubuntu-latest |
| 43 | + |
| 44 | + strategy: |
| 45 | + matrix: |
| 46 | + php-version: ['5.6', '7.1', '7.2', '7.3', '7.4'] |
| 47 | + dependencies: [''] |
| 48 | + include: |
| 49 | + - { php-version: '5.6', dependencies: '--prefer-lowest' } |
| 50 | + - { php-version: '8.0', dependencies: '--ignore-platform-req=php' } |
| 51 | + |
| 52 | + steps: |
| 53 | + - uses: actions/checkout@v2 |
| 54 | + |
| 55 | + - name: Setup PHP |
| 56 | + uses: shivammathur/setup-php@v2 |
| 57 | + with: |
| 58 | + php-version: ${{ matrix.php-version }} |
| 59 | + extensions: mbstring, intl, zip |
| 60 | + coverage: xdebug |
| 61 | + ini-values: ${{ matrix.xdebug-ini-values }} |
| 62 | + tools: composer:v2 |
| 63 | + |
| 64 | + - name: Install dependencies |
| 65 | + run: composer update --no-interaction ${{ matrix.dependencies }} |
| 66 | + |
| 67 | + - name: Apply PHPUnit patches |
| 68 | + if: ${{ matrix.php-version < 7.2 }} |
| 69 | + run: scripts/apply-phpunit-patches.sh |
| 70 | + |
| 71 | + - name: Run tests |
| 72 | + run: vendor/bin/phpunit --testsuite unit --colors=always --coverage-clover ./logs/clover.xml |
| 73 | + |
| 74 | + - name: Submit coverage to Coveralls |
| 75 | + # We use php-coveralls library for this, as the official Coveralls GitHub Action lacks support for clover reports: |
| 76 | + # https://github.com/coverallsapp/github-action/issues/15 |
| 77 | + env: |
| 78 | + COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 79 | + COVERALLS_PARALLEL: true |
| 80 | + COVERALLS_FLAG_NAME: ${{ github.job }}-PHP-${{ matrix.php-version }} ${{ matrix.dependencies }} |
| 81 | + run: | |
| 82 | + composer global require php-coveralls/php-coveralls |
| 83 | + ~/.composer/vendor/bin/php-coveralls -v |
| 84 | +
|
| 85 | + tests-finished: |
| 86 | + name: Tests finished |
| 87 | + needs: [unit-tests] |
| 88 | + runs-on: ubuntu-latest |
| 89 | + steps: |
| 90 | + - name: Notify Coveralls |
| 91 | + uses: coverallsapp/github-action@master |
| 92 | + with: |
| 93 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 94 | + parallel-finished: true |
0 commit comments