Skip to content

fix: workflow

fix: workflow #12

Workflow file for this run

name: CI
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
jobs:
test:
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.env.experimental == true }}
strategy:
fail-fast: false
matrix:
env:
- { php: 8.1}
- { php: 8.2}
- { php: 8.3, experimental: true }
steps:
- uses: actions/checkout@v3
- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.env.php }}
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: composer-${{ runner.os }}-${{ matrix.env.php }}-${{ hashFiles('composer.*') }}-${{ matrix.dependencies }}
restore-keys: |
composer-${{ runner.os }}-${{ matrix.env.php }}-${{ hashFiles('composer.*') }}-
composer-${{ runner.os }}-${{ matrix.env.php }}-
composer-${{ runner.os }}-
composer-
- name: Update Composer
run: |
sudo composer self-update
composer --version
- name: Validate composer.json and composer.lock
run: composer validate
- name: Install composer
run: composer install -o --no-interaction --no-suggest --prefer-dist
- name: PHPUnit tests
uses: php-actions/phpunit@v3
env:
XDEBUG_MODE: coverage
with:
coverage_clover: "build/clover.xml"
php_version: "${{ matrix.env.php }}"
php_extensions: "xdebug"
configuration: "phpunit.xml"
- uses: actions/upload-artifact@v3
with:
name: clover
path: build/clover.xml
- name: 'Generate Code Coverage Report'
uses: ./.github/actions/codecoverage
if: ${{ matrix.env.php == '8.2' && github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' }}
- name: Run Infection for added files only
run: |
git fetch --depth=1 origin $GITHUB_BASE_REF
vendor/bin/infection -j2 --git-diff-base="origin/develop" --git-diff-filter=A --git-diff-base=origin/$GITHUB_BASE_REF --logger-github --ignore-msi-with-no-mutations