Create dependabot.yml #5
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 Tests | |
on: | |
pull_request: | |
push: | |
permissions: | |
contents: read | |
jobs: | |
run: | |
runs-on: ${{ matrix.operating-system }} | |
strategy: | |
matrix: | |
operating-system: [ ubuntu-latest ] | |
php-version: ['8.2', '8.3'] | |
name: PHP ${{ matrix.php-version }} test on ${{ matrix.operating-system }} | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Install PHP | |
id: php | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-version }} | |
- name: Check PHP version | |
run: php -v | |
- name: Cache Composer packages | |
id: composer-cache | |
uses: actions/cache@v3 | |
with: | |
path: vendor | |
key: ${{ runner.os }}-${{ matrix.operating-system }}-php-${{ steps.php.outputs.php-version }} | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.operating-system }}-php-${{ steps.php.outputs.php-version }} | |
- if: steps.composer-cache.outputs.cache-hit != 'true' | |
name: Install Composer dependencies | |
run: composer install --prefer-dist --no-progress | |
- name: PHPUnit Tests | |
run: vendor/bin/phpunit --coverage-clover ./tests/coverage.xml | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ./tests/coverage.xml | |
flags: os-${{ matrix.operating-system }}_php-${{ matrix.php-version }} | |
verbose: true |