Skip to content

Commit

Permalink
refactor(ci): Review the mutation testing workflow (#1791)
Browse files Browse the repository at this point in the history
  • Loading branch information
theofidry committed Dec 22, 2022
1 parent a00379b commit a222e75
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions .github/workflows/mt.yaml
@@ -1,6 +1,15 @@
# yamllint disable rule:line-length
# yamllint disable rule:braces

# This build is to test the whole execute the PHPUnit tests & collect the coverage
# report and run infection.
# We are not interested in:
# - Running it on different systems (e.g. Windows, which was disabled because too slow)
# - Min/maxing the PHP version used: it can be any supported version
# - Using different dependencies than the locked ones
# - Using different code coverages
# All of those variants may be interesting but are better tested in more scoped
# tests like in ci.yaml.
name: Mutation Testing

on:
Expand All @@ -16,15 +25,9 @@ env:

jobs:
tests:
runs-on: ${{ matrix.operating-system }}
runs-on: ubuntu-latest

strategy:
matrix:
operating-system: [ubuntu-latest]
php-version: ['8.0']
coverage-driver: [pcov]

name: Mutation testing on ${{ matrix.operating-system }} with PHP ${{ matrix.php-version }}, using ${{ matrix.coverage-driver }}
name: Infection complete run on Infection

steps:
- name: Checkout code
Expand All @@ -33,9 +36,10 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: ${{ matrix.coverage-driver }}
tools: composer:v2.1
# Any supported PHP version is fine
php-version: '8.2'
coverage: pcov
tools: composer
env:
# This is necessary when installing a tool with a specific version
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -55,12 +59,13 @@ jobs:
composer-
- name: Install dependencies
run: |
composer update --no-interaction --prefer-dist --no-progress
# Run the locked dependencies: we are not interested in testing different
# variations here so having a stable set is better.
run: composer install --no-interaction --prefer-dist --no-progress

- name: Collect coverage report
run: |
php vendor/phpunit/phpunit/phpunit --stop-on-failure \
SYMFONY_DEPRECATIONS_HELPER=disabled php vendor/phpunit/phpunit/phpunit --stop-on-failure \
--coverage-xml=build/logs/coverage-xml \
--log-junit=build/logs/junit.xml
Expand Down

0 comments on commit a222e75

Please sign in to comment.