Refresh #1
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: Check Build | |
on: [pull_request] | |
jobs: | |
build: | |
strategy: | |
matrix: | |
php: ["8.1", "8.2", "8.3"] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
- name: Prepare environment | |
run: | | |
echo "COMPOSER_CACHE=$(composer config cache-dir)" >> $GITHUB_ENV | |
mkdir -p ~/.ssh | |
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts | |
- name: Composer Cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.COMPOSER_CACHE }} | |
key: ${{ runner.os }}-composer | |
- name: Install dependencies | |
run: | | |
composer update --no-progress --no-interaction > /dev/null | |
- name: Check Dependencies | |
run: composer check-deps | |
- name: Check Code Style | |
run: PHP_CS_FIXER_IGNORE_ENV=1 composer cs-check | |
- name: PHPStan | |
run: composer phpstan -- --no-progress | |
- name: Psalm | |
run: composer psalm | |
- name: Infection coverage of changed lines | |
if: "!contains(github.event.pull_request.labels.*.name, 'skip-infection')" | |
run: | | |
git fetch origin $GITHUB_BASE_REF $GITHUB_HEAD_REF | |
vendor/bin/infection \ | |
--git-diff-base=origin/$GITHUB_BASE_REF \ | |
--git-diff-lines \ | |
--logger-github \ | |
--min-msi=100 \ | |
--min-covered-msi=100 \ | |
--ignore-msi-with-no-mutations \ | |
-jmax | |
- name: Save Infection result | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: infection-log-${{ matrix.php }}.txt | |
path: infection-log.txt | |
- name: PHPUnit | |
run: vendor/bin/phpunit --coverage-clover=coverage.xml --stop-on-failure | |
- name: Monitor coverage | |
if: github.event_name == 'pull_request' | |
uses: slavcodev/coverage-monitor-action@v1 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
coverage_path: "coverage.xml" | |
comment: false | |
comment_context: Coverage PHP ${{ matrix.php }} | |
status_context: Coverage PHP ${{ matrix.php }} | |
threshold_alert: 83 | |
threshold_warning: 83 |