Update testing.yml #7
This file contains hidden or 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: testing | |
on: | |
push: | |
branches: [ "unit-testing" ] | |
pull_request: | |
branches: [ "unit-testing" ] | |
jobs: | |
phpunit: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
php: [8.1, 8.2, 8.3] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install PHP with extensions. | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
- name: Determine composer cache directory on Linux. | |
if: matrix.os == 'ubuntu-latest' | |
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV | |
- name: Update composer. | |
run: composer self-update | |
- name: Install dependencies with composer. | |
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi | |
- name: Run tests with phpunit with code coverage. | |
run: vendor/bin/phpunit tests |