Skip to content

Commit bee4e01

Browse files
committed
setup ci/cd
1 parent e72f830 commit bee4e01

File tree

7 files changed

+409
-20
lines changed

7 files changed

+409
-20
lines changed

.github/workflows/pint.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Run tests
2+
3+
on: [push]
4+
5+
jobs:
6+
tests:
7+
name: Run tests
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v3
11+
12+
- name: Setup PHP
13+
uses: shivammathur/setup-php@v2
14+
with:
15+
php-version: '8.3'
16+
extensions: pcntl, curl, pdo_mysql, zip, curl, redis
17+
coverage: none
18+
19+
- name: Install Pint
20+
run: composer global require laravel/pint
21+
22+
- name: Run Pint
23+
run: pint

.github/workflows/stan.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Static Analysis
2+
3+
on: [push]
4+
5+
jobs:
6+
phpstan:
7+
name: phpstan
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v3
11+
12+
- name: Setup PHP
13+
uses: shivammathur/setup-php@v2
14+
with:
15+
php-version: '8.3'
16+
coverage: none
17+
18+
- name: Install composer dependencies
19+
run: composer install -n --prefer-dist
20+
21+
- name: Run Static Analysis
22+
run: ./vendor/bin/phpstan analyse --error-format=github

.github/workflows/tests.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Run tests
2+
3+
on: [push]
4+
5+
jobs:
6+
tests:
7+
name: Run tests
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v3
11+
12+
- name: Setup PHP
13+
uses: shivammathur/setup-php@v2
14+
with:
15+
php-version: '8.3'
16+
extensions: pcntl, curl, pdo_mysql, zip, curl, redis
17+
coverage: none
18+
19+
- name: Run composer install
20+
run: composer install -n --prefer-dist
21+
22+
- name: Prepare Laravel Application
23+
run: |
24+
cp .env.ci .env
25+
php artisan key:generate
26+
27+
- name: Run tests
28+
run: php artisan test

app/Models/User.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,35 +9,19 @@
99

1010
class User extends Authenticatable
1111
{
12-
/** @use HasFactory<\Database\Factories\UserFactory> */
1312
use HasFactory, Notifiable;
1413

15-
/**
16-
* The attributes that are mass assignable.
17-
*
18-
* @var array<int, string>
19-
*/
2014
protected $fillable = [
2115
'name',
2216
'email',
2317
'password',
2418
];
2519

26-
/**
27-
* The attributes that should be hidden for serialization.
28-
*
29-
* @var array<int, string>
30-
*/
3120
protected $hidden = [
3221
'password',
3322
'remember_token',
3423
];
3524

36-
/**
37-
* Get the attributes that should be cast.
38-
*
39-
* @return array<string, string>
40-
*/
4125
protected function casts(): array
4226
{
4327
return [

composer.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,18 @@
55
"keywords": ["laravel", "framework"],
66
"license": "MIT",
77
"require": {
8-
"php": "^8.2",
8+
"php": "^8.3",
9+
"guzzlehttp/guzzle": "^7.9",
910
"laravel/framework": "^11.9",
11+
"laravel/horizon": "^5.29",
1012
"laravel/octane": "^2.5",
1113
"laravel/tinker": "^2.9"
1214
},
1315
"require-dev": {
1416
"fakerphp/faker": "^1.23",
17+
"larastan/larastan": "^3.0",
1518
"laravel/pail": "^1.1",
16-
"laravel/pint": "^1.13",
19+
"laravel/pint": "^1.18",
1720
"laravel/sail": "^1.26",
1821
"mockery/mockery": "^1.6",
1922
"nunomaduro/collision": "^8.1",

0 commit comments

Comments
 (0)