Update dependency phpstan/phpstan-phpunit to v2 #6049
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: Test Application | |
on: [push, pull_request] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
env: | |
DB_DATABASE: babdev_test | |
DB_USERNAME: root | |
DB_PASSWORD: password | |
strategy: | |
fail-fast: true | |
matrix: | |
include: | |
- php: '8.2' | |
name: "Test Application - PHP ${{ matrix.php }}" | |
services: | |
mysql: | |
image: mysql:9.1 | |
env: | |
MYSQL_ALLOW_EMPTY_PASSWORD: false | |
MYSQL_DATABASE: babdev_test | |
MYSQL_ROOT_PASSWORD: password | |
ports: | |
- 3306/tcp | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Start MySQL service | |
run: sudo systemctl start mysql | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
tools: composer:v2 | |
extensions: curl, dom, libxml, mbstring, pcntl, pdo, pdo_mysql, zip | |
coverage: none | |
- name: Setup NodeJS | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
cache: npm | |
- name: Get Composer Cache Directory | |
id: composer-cache | |
run: | | |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
- name: Setup Composer Cache | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-php-${{ matrix.php }}-composer- | |
- name: Setup .env | |
run: cp .env.example .env | |
- name: Install Composer Dependencies | |
run: composer install --no-interaction | |
- name: Install NPM Dependencies | |
run: npm ci | |
- name: Compile Assets | |
run: npm run build | |
- name: Generate App Key | |
run: php artisan key:generate | |
- name: Execute Tests | |
run: php artisan test | |
env: | |
DB_PORT: ${{ job.services.mysql.ports['3306'] }} |