-
Notifications
You must be signed in to change notification settings - Fork 8
67 lines (57 loc) · 1.63 KB
/
tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Run Tests
on:
pull_request:
branches:
- main
jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
connection: ['mysql', 'pgsql']
include:
- connection: 'mysql'
port: 3306
- connection: 'pgsql'
port: 5432
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 }}
run: php artisan test --compact --coverage --min=80