Skip to content

Require coverage metadata in phpunit.xml.dist #1651

Require coverage metadata in phpunit.xml.dist

Require coverage metadata in phpunit.xml.dist #1651

Workflow file for this run

# yamllint disable rule:line-length
# yamllint disable rule:braces
name: Autoreview
on:
pull_request:
push:
branches:
- main
- master
jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
# Should use the latest supported PHP version
php-version: ['8.2']
name: Autoreview on PHP ${{ matrix.php-version }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: composer
env:
# This is necessary when installing a tool with a specific version
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('composer.*') }}
restore-keys: |
composer-${{ runner.os }}-${{ matrix.php-version }}-
composer-${{ runner.os }}-
composer-
- name: Install dependencies
run: |
composer install --no-interaction --prefer-dist --no-progress
- name: Run auto-review tests
# Ensures we see all the errors
run: make autoreview --keep-going
# This is a meta job to avoid to have to constantly change the protection rules
# whenever we touch the matrix.
tests-status:
name: Autoreview Status
runs-on: ubuntu-latest
needs: tests
if: always()
steps:
- name: Successful run
if: ${{ !(contains(needs.*.result, 'failure')) }}
run: exit 0
- name: Failing run
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1