Bump phpstan/phpstan from 1.10.39 to 1.10.47 #34
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: Build | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
standards: | |
name: Code Standards | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- | |
name: Set up PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '7.4' | |
extensions: mbstring | |
tools: cs2pr | |
coverage: pcov | |
- | |
name: Validate composer.json and composer.lock | |
run: composer validate | |
- | |
name: Get composer cache directory | |
id: composer-cache | |
run: | | |
echo "::set-output name=dir::$(composer config cache-files-dir)" | |
- | |
name: Cache dependencies | |
uses: actions/cache@v1 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: ${{ runner.os }}-composer- | |
- | |
name: Install dependencies | |
run: composer install --prefer-dist --no-progress --no-suggest | |
- | |
name: Normalize composer file | |
run: composer normalize --dry-run | |
- | |
name: Lint | |
run: vendor/bin/parallel-lint --colors src tests | |
- | |
name: Codesniffer | |
# crank the warning severity because cs2pr treats warnings as failures | |
run: | | |
vendor/bin/phpcs -q --warning-severity=10 --report=checkstyle | cs2pr | |
tests: | |
name: PHP ${{ matrix.php-version }}, ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
php-version: ['7.4', '8.0', '8.1', '8.2'] | |
# os: [ubuntu-latest, macos-latest, windows-latest] | |
os: [ubuntu-latest] | |
steps: | |
- uses: actions/checkout@v2 | |
- | |
name: Set up PHP ${{ matrix.php-version }} | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-version }} | |
extensions: mbstring | |
coverage: pcov | |
tools: cs2pr | |
- | |
name: Setup Problem Matchers for PHP | |
run: | | |
echo "::add-matcher::${{ runner.tool_cache }}/php.json" | |
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | |
- | |
name: Validate composer.json and composer.lock | |
run: composer validate | |
- | |
name: Get Composer Cache Directory | |
id: composer-cache | |
run: | | |
echo "::set-output name=dir::$(composer config cache-files-dir)" | |
- | |
name: Cache dependencies | |
uses: actions/cache@v1 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: ${{ runner.os }}-composer- | |
- | |
name: Install dependencies | |
run: composer install --prefer-dist --no-progress --no-suggest | |
- | |
name: PHPUnit | |
if: matrix.php-version != '7.4' || matrix.os != 'ubuntu-latest' | |
run: vendor/bin/phpunit | |
- | |
name: PHPUnit w/ code coverage | |
if: matrix.php-version == '7.4' && matrix.os == 'ubuntu-latest' | |
run: vendor/bin/phpunit --coverage-clover coverage.xml | |
analysis: | |
name: Static Analysis | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- | |
name: Set up PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '7.4' | |
extensions: mbstring | |
tools: cs2pr | |
- | |
name: Validate composer.json and composer.lock | |
run: composer validate | |
- | |
name: Get Composer Cache Directory | |
id: composer-cache | |
run: | | |
echo "::set-output name=dir::$(composer config cache-files-dir)" | |
- | |
name: Cache dependencies | |
uses: actions/cache@v1 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: ${{ runner.os }}-composer- | |
- | |
name: Install dependencies | |
run: composer install --prefer-dist --no-progress --no-suggest | |
- | |
name: Static Analysis | |
run: vendor/bin/phpstan analyse --error-format=checkstyle | sed '/^$/d' | cs2pr | |
mutation: | |
name: Mutation Testing | |
runs-on: ubuntu-latest | |
steps: | |
- | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- | |
name: Set up PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '7.4' | |
extensions: mbstring | |
tools: cs2pr | |
coverage: pcov | |
- | |
name: Validate composer.json and composer.lock | |
run: composer validate | |
- | |
name: Get Composer Cache Directory | |
id: composer-cache | |
run: | | |
echo "::set-output name=dir::$(composer config cache-files-dir)" | |
- | |
name: Cache dependencies | |
uses: actions/cache@v1 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: ${{ runner.os }}-composer- | |
- | |
name: Install dependencies | |
run: composer install --prefer-dist --no-progress --no-suggest | |
- | |
name: Mutation Testing | |
run: | | |
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/* | |
CHANGED_FILES=$(git diff --diff-filter=AM --name-only origin/${{ github.base_ref }}..${{ github.sha }} | grep src/ | paste -sd "," -); | |
if [ -n "$CHANGED_FILES" ]; then | |
php -d memory_limit=-1 vendor/bin/infection --threads=4 --filter=${CHANGED_FILES} --only-covered --min-msi=80 --min-covered-msi=80 --ignore-msi-with-no-mutations | |
else | |
echo "No source files changed" | |
fi |