1
0
mirror of https://github.com/phpmyadmin/phpmyadmin.git synced 2026-10-25 06:39:48 +03:00
Files
phpmyadmin/.github/workflows/mutation-tests.yml
Maurício Meneghini Fauth 358f7c0c43 Upgrade ramsey/composer-install GH action to v3
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2024-07-08 14:37:21 -03:00

69 lines
2.0 KiB
YAML

name: Mutation tests
on:
push:
branches: [master]
pull_request:
branches: [master]
permissions:
contents: read
jobs:
tests:
name: Mutation tests with PHP ${{ matrix.php-version }}
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
php-version: ["8.1"]
operating-system: [ubuntu-latest]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Fetch github.base_ref (for diffing)
if: ${{ github.base_ref != '' }}
run: |
git fetch --depth=1 origin +refs/heads/${{ github.base_ref }}:refs/remotes/origin/${{ github.base_ref }}
- name: Install Gettext
run: |
sudo apt-get install -y gettext
- name: Generate mo files
run: ./scripts/generate-mo --quiet
- name: Set up PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: pcov
ini-values: memory_limit=-1
tools: composer:v2, infection
- name: Install Composer dependencies
uses: ramsey/composer-install@v3
with:
dependency-versions: highest
- name: Collect coverage report
run: |
composer run phpunit -- --testsuite unit --stop-on-failure
- name: Infection
if: ${{ github.base_ref != '' }}
run: |
CHANGED_FILES=$(git diff origin/$GITHUB_BASE_REF --diff-filter=AM --name-only | grep libraries/classes/ | paste -sd "," -);
infection -j$(nproc) --skip-initial-tests --no-interaction --no-progress --coverage=build/logs \
--ignore-msi-with-no-mutations \
--filter=$CHANGED_FILES
env:
INFECTION_BADGE_API_KEY: ${{ secrets.INFECTION_BADGE_API_KEY }}
- name: Infection
if: ${{ github.base_ref == '' }}
run: |
infection -j$(nproc) --skip-initial-tests --no-interaction --no-progress --coverage=build/logs
env:
INFECTION_BADGE_API_KEY: ${{ secrets.INFECTION_BADGE_API_KEY }}