Try fixed MySQL credentials #241
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: Run Tests | |
on: | |
push: | |
paths: | |
- '**.php' | |
- '.github/workflows/run-tests.yml' | |
- 'phpunit.xml.dist' | |
- 'composer.json' | |
- 'composer.lock' | |
pull_request: | |
paths: | |
- '**.php' | |
- '.github/workflows/run-tests.yml' | |
- 'phpunit.xml.dist' | |
- 'composer.json' | |
- 'composer.lock' | |
schedule: | |
- cron: '0 7 * * 3' | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
matrix: | |
php: [8.3, 8.2, 8.1] | |
laravel: ['10.*', '11.*'] | |
stability: [lowest, highest] | |
database: [sqlite, mysql] | |
exclude: | |
- laravel: 11.* | |
php: 8.1 | |
services: | |
mysql: | |
image: ${{ matrix.database == 'mysql' && 'mysql:5.7' || '' }} | |
env: | |
MYSQL_DATABASE: test | |
MYSQL_ROOT_PASSWORD: password | |
ports: | |
- 3306:3306 | |
options: >- | |
--health-cmd "mysqladmin ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
name: "P${{ matrix.php }} - L${{ matrix.laravel }} - S: ${{ matrix.stability }} | ${{ matrix.database }}" | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
extensions: mbstring, zip, pdo, sqlite, pdo_sqlite, bcmath, fileinfo | |
coverage: none | |
- name: Setup problem matchers | |
run: | | |
echo "::add-matcher::${{ runner.tool_cache }}/php.json" | |
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | |
- name: Setup Laravel version | |
run: | | |
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update | |
- name: Install composer dependencies | |
uses: ramsey/composer-install@v3 | |
with: | |
dependency-versions: ${{ matrix.stability }} | |
- name: Execute tests | |
run: vendor/bin/pest | |
env: | |
DB_CONNECTION: ${{ matrix.database }} | |
DB_DATABASE: test | |
DB_USERNAME: root | |
DB_PASSWORD: password |