-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (55 loc) · 1.76 KB
/
ci.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
name: Laravel CI
on: [push, pull_request] # Run CI on every push and PR
jobs:
laravel-tests:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8
env:
MYSQL_DATABASE: testing_db
MYSQL_USER: user
MYSQL_PASSWORD: password
MYSQL_ROOT_PASSWORD: root
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping --host=localhost --user=root --password=root"
--health-interval=10s
--health-timeout=5s
--health-retries=3
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
extensions: mbstring, bcmath, pdo, pdo_mysql
coverage: none
- name: Install Composer Dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader
- name: Setup Environment
run: |
cp .env.example .env
php artisan key:generate
- name: Run Migrations
env:
DB_CONNECTION: mysql
DB_DATABASE: testing_db
DB_USERNAME: user
DB_PASSWORD: password
DB_HOST: 127.0.0.1
run: php artisan migrate --force
- name: Run Pint (Code Formatting)
run: composer require laravel/pint --dev && ./vendor/bin/pint --test
- name: Run PHPStan (Static Analysis)
run: composer require nunomaduro/larastan --dev && ./vendor/bin/phpstan analyse --memory-limit=1G
- name: Run Pest Tests
env:
DB_CONNECTION: mysql
DB_DATABASE: testing_db
DB_USERNAME: user
DB_PASSWORD: password
DB_HOST: 127.0.0.1
run: php artisan test --parallel