Skip to content

⬆ Upgrade to GitHub-native Dependabot (#17) #8

⬆ Upgrade to GitHub-native Dependabot (#17)

⬆ Upgrade to GitHub-native Dependabot (#17) #8

Workflow file for this run

name: Coverage
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4 # TODO ocular not compatible php8 https://github.com/scrutinizer-ci/ocular/issues/51
coverage: xdebug
- name: Setup problem matchers
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: composer update --prefer-dist --no-interaction
- name: Execute tests
run: php vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover
- name: Send coverage to Scrutinizer
run: |
wget https://scrutinizer-ci.com/ocular.phar
php ocular.phar code-coverage:upload --format=php-clover coverage.clover