Skip to content

Update php.yml

Update php.yml #144

Workflow file for this run

name: Tests
on:
push:
branches:
- master
- 3.0/test
jobs:
build:
runs-on: ubuntu-latest
env:
XDEBUG_MODE: coverage
steps:
- uses: actions/checkout@v4
with:
# Fetch 10 commits or Scrutinizer will throw ("Failed to retrieve commit parents. If you use a shallow git checkout, please checkout at least a depth of one."), see: RepositoryIntrospector at scrutinizer-ci/ocular GitHub repository
# 10 commits is an arbitrary value that is more than 1 commit
fetch-depth: 10
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --prefer-dist --no-progress
- name: Run test suite
run: php vendor/bin/phpunit:^1.9
- run: composer require --dev scrutinizer/ocular
- name: Uploading code coverage
run: php vendor/bin/ocular code-coverage:upload --format=php-clover coverage.clover.xml