xref: /webtrees/.github/workflows/phpunit.yaml (revision b6017f990d38d8c56e04c0096ce9a7e8745ad4ba)
19b152ff9SGreg Roachname: Unit tests
29b152ff9SGreg Roach
39b152ff9SGreg Roachon: [push, pull_request]
49b152ff9SGreg Roach
59b152ff9SGreg Roachjobs:
69b152ff9SGreg Roach  run:
79b152ff9SGreg Roach    runs-on: ${{ matrix.operating-system }}
89b152ff9SGreg Roach
99b152ff9SGreg Roach    strategy:
109b152ff9SGreg Roach      matrix:
119b152ff9SGreg Roach        operating-system: [ubuntu-latest]
129b152ff9SGreg Roach        php-version: ['7.1', '7.2', '7.3', '7.4']
139b152ff9SGreg Roach
149b152ff9SGreg Roach    name: Testing PHP ${{ matrix.php-version }} on ${{ matrix.operating-system }}
159b152ff9SGreg Roach
169b152ff9SGreg Roach    steps:
179b152ff9SGreg Roach      - uses: shivammathur/setup-php@master
189b152ff9SGreg Roach        with:
199b152ff9SGreg Roach          php-version: ${{ matrix.php-version }}
201792ff1cSGreg Roach          extensions: gd,intl,mbstring,sqlite,zip
219b152ff9SGreg Roach          coverage: pcov
229b152ff9SGreg Roach
23*b6017f99SGreg Roach      - uses: actions/checkout@v2
249b152ff9SGreg Roach
259b152ff9SGreg Roach      - run: composer validate
269b152ff9SGreg Roach
27*b6017f99SGreg Roach      - run: composer install --no-progress
289b152ff9SGreg Roach
299b152ff9SGreg Roach      - run: composer require pcov/clobber
309b152ff9SGreg Roach      - run: vendor/bin/pcov clobber
319b152ff9SGreg Roach
329b152ff9SGreg Roach      - run: vendor/bin/phpunit --coverage-clover=tests/coverage.xml
339b152ff9SGreg Roach
349b152ff9SGreg Roach      - uses: codecov/codecov-action@v1
359b152ff9SGreg Roach        with:
369b152ff9SGreg Roach          token: ${{ secrets.CODECOV_TOKEN }}
379b152ff9SGreg Roach          file: tests/coverage.xml
38