Skip to content

Refresh Package

Refresh Package #58

Workflow file for this run

name: Check Build
on: [pull_request]
jobs:
build:
strategy:
matrix:
php: ["8.2", "8.3", "8.4"]
composer_args:
- '--prefer-lowest'
- ''
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: pcov
tools: composer:v2
- name: Prepare environment
run: |
mkdir -p /root/.ssh
ssh-keyscan -t rsa github.com >> /root/.ssh/known_hosts
echo "COMPOSER_CACHE=$(composer config cache-dir)" >> $GITHUB_ENV
- name: Composer Cache
uses: actions/cache@v4
with:
path: |
${{ env.COMPOSER_CACHE }}
vendor
key: ${{ runner.os }}-composer
- name: Install dependencies
run: |
composer update --no-progress --no-interaction ${{ matrix.composer_args }} > /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: Tests
run: |
vendor/bin/phpunit --coverage-clover=coverage.xml --stop-on-failure
composer run --timeout=0 infection
- name: Save Infection result
uses: actions/upload-artifact@v4
if: always()
with:
name: infection-log-${{ matrix.php }}.txt
path: infection-log.txt
- 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 }}-${{ matrix.composer_args }}
status_context: Coverage PHP ${{ matrix.php }}-${{ matrix.composer_args }}
threshold_alert: 100
threshold_warning: 100