Skip to content

Update composer and CI workflow for better test coverage #163

Update composer and CI workflow for better test coverage

Update composer and CI workflow for better test coverage #163

Workflow file for this run

name: "CI Tests"
on:
pull_request:
push:
jobs:
php81:
name: PHP 8.1
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: "actions/checkout@v4"
with:
fetch-depth: 2
- name: "Install PHP 8.1"
uses: "shivammathur/setup-php@v2"
with:
php-version: "8.1"
- name: "Cache composer packages"
uses: "actions/cache@v4"
with:
path: "vendor"
key: "php-composer-locked-php-8.1-${{ hashFiles('**/composer.lock') }}"
restore-keys: "php-composer-locked-php-8.1-"
- name: "Install dependencies with composer"
run: "composer install --no-interaction --prefer-dist"
- name: "Run PHPUnit Tests"
run: "composer test"
- name: "Run PHP CS Check"
run: "composer cs-check"
- name: "Run PHPStan"
run: "composer analyze"
- name: "Run Psalm"
run: "composer psalm"
- name: "PHP Lint"
run: "composer lint"
- name: "Run infection"
run: "composer infection-ci"
php82:
name: PHP 8.2
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: "actions/checkout@v4"
with:
fetch-depth: 2
- name: "Install PHP 8.2"
uses: "shivammathur/setup-php@v2"
with:
php-version: "8.2"
- name: "Cache composer packages"
uses: "actions/cache@v4"
with:
path: "vendor"
key: "php-composer-locked-php-8.2-${{ hashFiles('**/composer.lock') }}"
restore-keys: "php-composer-locked-php-8.2-"
- name: "Install dependencies with composer"
run: "composer install --no-interaction --prefer-dist"
- name: "Run PHPUnit Tests"
run: "composer test"
- name: "Run PHP CS Check"
run: "PHP_CS_FIXER_IGNORE_ENV=1 composer cs-check"
- name: "Run PHPStan"
run: "composer analyze"
- name: "Run Psalm"
run: "composer psalm"
- name: "PHP Lint"
run: "composer lint"
- name: "Run infection"
run: "composer infection-ci"
php83:
name: PHP 8.3
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: "actions/checkout@v4"
with:
fetch-depth: 2
- name: "Install PHP 8.3"
uses: "shivammathur/setup-php@v2"
with:
php-version: "8.3"
- name: "Cache composer packages"
uses: "actions/cache@v4"
with:
path: "vendor"
key: "php-composer-locked-php-8.3-${{ hashFiles('**/composer.lock') }}"
restore-keys: "php-composer-locked-php-8.3-"
- name: "Install dependencies with composer"
run: "composer install --no-interaction --prefer-dist"
- name: "Run PHPUnit Tests"
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
composer test
composer global require php-coveralls/php-coveralls
php-coveralls --coverage_clover=build/output/tests/coverage.xml --json_path=build/output/tests/coveralls-upload.json -v
- name: "Run PHP CS Check"
run: "PHP_CS_FIXER_IGNORE_ENV=1 composer cs-check"
- name: "Run PHPStan"
run: "composer analyze"
- name: "Run Psalm"
run: "composer psalm"
- name: "PHP Lint"
run: "composer lint"
- name: "Run infection"
env:
INFECTION_BADGE_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
run: "composer infection-ci"