Feature/add ecs #18
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.env.php }} | |
- name: Cache dependencies | |
uses: actions/cache@v2 | |
with: | |
path: vendor | |
key: composer-${{ runner.os }}-${{ matrix.env.php }}-${{ hashFiles('composer.*') }} | |
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 | |
if: ${{ github.event_name == 'pull_request' }} | |
run: | | |
git fetch --depth=1 origin $GITHUB_BASE_REF | |
vendor/bin/infection -j2 --git-diff-filter=A --git-diff-base=origin/$GITHUB_BASE_REF --logger-github --ignore-msi-with-no-mutations |