BEdita API and Core 5.29, cakephp 4.5 #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: 'php' | |
on: | |
pull_request: | |
paths: | |
- '**/*.php' | |
- '.github/workflows/php.yml' | |
- 'composer.json' | |
push: | |
paths: | |
- '**/*.php' | |
- '.github/workflows/php.yml' | |
- 'composer.json' | |
jobs: | |
cs: | |
uses: bedita/github-workflows/.github/workflows/php-cs.yml@v2 | |
with: | |
php_versions: '["8.3"]' | |
stan: | |
uses: bedita/github-workflows/.github/workflows/php-stan.yml@v2 | |
with: | |
php_versions: '["8.3"]' | |
unit: | |
name: 'Run unit tests' | |
if: "!contains(github.event.commits[0].message, '[skip ci]') && !contains(github.event.commits[0].message, '[ci skip]')" | |
runs-on: 'ubuntu-latest' | |
strategy: | |
fail-fast: false | |
matrix: | |
php: | |
- '8.2' | |
- '8.3' | |
env: | |
PHP_VERSION: '${{ matrix.php }}' | |
steps: | |
- name: 'Checkout current revision' | |
uses: 'actions/checkout@v2' | |
- name: 'Setup PHP' | |
uses: 'shivammathur/setup-php@v2' | |
with: | |
php-version: '${{ matrix.php }}' | |
tools: 'composer' | |
extensions: 'mbstring, intl' | |
coverage: 'xdebug' | |
- name: 'Discover Composer cache directory' | |
id: 'cachedir' | |
run: 'echo "::set-output name=path::$(composer global config cache-dir)"' | |
- name: 'Share Composer cache across runs' | |
uses: 'actions/cache@v2' | |
with: | |
path: '${{ steps.cachedir.outputs.path }}' | |
key: "composer-${{ matrix.php }}-${{ hashFiles('**/composer.json') }}" | |
restore-keys: | | |
composer-${{ matrix.php }}- | |
composer- | |
- name: 'Install dependencies with Composer' | |
run: 'composer install --prefer-dist --no-interaction' | |
- name: 'Dump Composer autoloader' | |
run: 'composer dump-autoload --classmap-authoritative --no-cache' | |
- name: 'Run PHPUnit' | |
run: 'vendor/bin/phpunit --coverage-clover=${{ matrix.php-version }}-${{ strategy.job-index }}-clover.xml' | |
- name: Check test coverage | |
id: test-coverage | |
uses: johanvanhelden/gha-clover-test-coverage-check@v1 | |
with: | |
percentage: '85' | |
filename: '${{ matrix.php-version }}-${{ strategy.job-index }}-clover.xml' | |
- name: 'Export coverage results' | |
uses: 'codecov/codecov-action@v4' | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} # required | |
files: './${{ matrix.php-version }}-${{ strategy.job-index }}-clover.xml' | |
env_vars: PHP_VERSION | |
- name: 'Archive code coverage results' | |
uses: 'actions/upload-artifact@v4' | |
with: | |
name: 'PHP-${{ matrix.php-version }}-strategy-job-index-${{ strategy.job-index }}' | |
path: '${{ matrix.php-version }}-${{ strategy.job-index }}-clover.xml' | |
unit-lowest: | |
name: 'Run unit tests with lowest-matching dependencies versions' | |
if: "!contains(github.event.commits[0].message, '[skip ci]') && !contains(github.event.commits[0].message, '[ci skip]')" | |
runs-on: 'ubuntu-latest' | |
steps: | |
- name: 'Checkout current revision' | |
uses: 'actions/checkout@v2' | |
- name: 'Setup PHP' | |
uses: 'shivammathur/setup-php@v2' | |
with: | |
php-version: '8.2' | |
tools: 'composer' | |
extensions: 'mbstring, intl' | |
- name: 'Discover Composer cache directory' | |
id: 'cachedir' | |
run: 'echo "::set-output name=path::$(composer global config cache-dir)"' | |
- name: 'Share Composer cache across runs' | |
uses: 'actions/cache@v2' | |
with: | |
path: '${{ steps.cachedir.outputs.path }}' | |
key: "composer-lowest-${{ hashFiles('**/composer.json') }}" | |
restore-keys: | | |
composer-lowest- | |
composer- | |
- name: 'Update dependencies with Composer' | |
run: 'composer update --prefer-lowest --prefer-dist --no-interaction' | |
- name: 'Dump Composer autoloader' | |
run: 'composer dump-autoload --classmap-authoritative --no-cache' | |
- name: 'Run PHPUnit' | |
run: 'vendor/bin/phpunit' |