summaryrefslogtreecommitdiff
path: root/.github/workflows/phpunit.yaml
blob: 8f02b92b732db2cbbea50db965afdf2648a27fae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Unit tests

on: [push, pull_request]

jobs:
  run:
    runs-on: ${{ matrix.operating-system }}

    strategy:
      matrix:
        operating-system: [ubuntu-latest]
        php-version: ['7.1', '7.2', '7.3', '7.4']

    name: Testing PHP ${{ matrix.php-version }} on ${{ matrix.operating-system }}

    steps:
      - uses: shivammathur/setup-php@master
        with:
          php-version: ${{ matrix.php-version }}
          extensions: gd,intl,mbstring,sqlite,zip
          coverage: pcov

      - uses: actions/checkout@v2

      - run: composer validate

      - run: composer install --no-progress

      - run: composer require pcov/clobber
      - run: vendor/bin/pcov clobber

      - run: vendor/bin/phpunit --coverage-clover=tests/coverage.xml

      - uses: codecov/codecov-action@v1
        with:
          token: ${{ secrets.CODECOV_TOKEN }}
          file: tests/coverage.xml