wip #82
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: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
connection: ['mysql', 'pgsql'] | |
include: | |
- connection: 'mysql' | |
port: 3306 | |
password: '' | |
- connection: 'pgsql' | |
port: 5432 | |
password: 'password' | |
services: | |
redis: | |
image: redis:7.4 | |
ports: | |
- 6379:6379 | |
mysql: | |
image: ${{ matrix.connection == 'mysql' && 'mysql:8.0' || '' }} | |
ports: | |
- ${{ matrix.port }}:${{ matrix.port }} | |
env: | |
MYSQL_DATABASE: laravel | |
MYSQL_ALLOW_EMPTY_PASSWORD: yes | |
postgres: | |
image: ${{ matrix.connection == 'pgsql' && 'postgres:17.0' || '' }} | |
ports: | |
- ${{ matrix.port }}:${{ matrix.port }} | |
env: | |
POSTGRES_PASSWORD: password | |
POSTGRES_USER: root | |
POSTGRES_DB: laravel | |
steps: | |
- name: Checkout Code | |
uses: actions/[email protected] | |
- name: Setup | |
uses: ./.github/actions/setup | |
with: | |
php-version: ${{ matrix.php }} | |
nova-email: ${{ secrets.NOVA_EMAIL }} | |
nova-password: ${{ secrets.NOVA_PASSWORD }} | |
coverage: xdebug | |
- name: Install Project Dependencies | |
run: composer install -q --no-interaction --no-progress | |
- name: Copy Environment File | |
run: cp .env.example .env | |
- name: Generate Application Key | |
run: php artisan key:generate | |
- name: Run Tests | |
env: | |
DB_CONNECTION: ${{ matrix.connection }} | |
DB_PORT: ${{ matrix.port }} | |
DB_PASSWORD: ${{ matrix.password }} | |
run: php artisan test --compact --coverage --min=80 |