xref: /webtrees/.github/workflows/phpunit.yaml (revision d62ae68e24d451faa2c02451650eabf25a43a980)
1name: Unit tests
2
3on: [push, pull_request]
4
5jobs:
6  run:
7    runs-on: ${{ matrix.operating-system }}
8
9    strategy:
10      matrix:
11        operating-system: [ubuntu-latest]
12        php-version: ['7.1', '7.2', '7.3', '7.4']
13
14    name: Testing PHP ${{ matrix.php-version }} on ${{ matrix.operating-system }}
15
16    steps:
17      - uses: shivammathur/setup-php@master
18        with:
19          php-version: ${{ matrix.php-version }}
20          extension-csv: gd,intl,mbstring,pdo_sqlite,sqlite3,zip
21          coverage: pcov
22
23      - uses: actions/checkout@v1
24        with:
25          fetch-depth: 1
26
27      - run: composer validate
28
29      - run: composer install --prefer-dist --no-progress --no-suggest --ignore-platform-reqs
30
31      - run: composer require pcov/clobber
32      - run: vendor/bin/pcov clobber
33
34      - run: vendor/bin/phpunit --coverage-clover=tests/coverage.xml
35
36      - uses: codecov/codecov-action@v1
37        with:
38          token: ${{ secrets.CODECOV_TOKEN }}
39          file: tests/coverage.xml
40