Skip to content

Commit 76a8ba9

Browse files
authored
Merge pull request #3 from luimedi/develop
Add Laravel Pint and Git Hooks with GitHub Actions workflow
2 parents 049d7c3 + 97fbcc9 commit 76a8ba9

56 files changed

Lines changed: 1190 additions & 301 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/pint.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Pint
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
pint:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Setup PHP
18+
uses: shivammathur/setup-php@v2
19+
with:
20+
php-version: '8.5'
21+
22+
- name: Get composer cache
23+
uses: actions/cache@v4
24+
with:
25+
path: ~/.composer/cache
26+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
27+
restore-keys: |
28+
${{ runner.os }}-composer-
29+
30+
- name: Install composer deps
31+
run: composer install --no-progress --no-suggest --prefer-dist
32+
33+
- name: Run Laravel Pint (test)
34+
run: ./vendor/bin/pint --test

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
/vendor
2-
/.phpunit.result.cache
2+
/.phpunit.result.cache
3+
/node_modules

composer.json

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,31 @@
2424
"php": ">=8.3"
2525
},
2626
"require-dev": {
27-
"phpunit/phpunit": "^12"
27+
"phpunit/phpunit": "^12",
28+
"laravel/pint": "^1.27",
29+
"brainmaestro/composer-git-hooks": "^3.0"
2830
},
2931
"scripts": {
30-
"test": "phpunit"
32+
"test": "phpunit",
33+
"cghooks": "vendor/bin/cghooks",
34+
"post-install-cmd": [
35+
"cghooks add --ignore-lock"
36+
],
37+
"post-update-cmd": [
38+
"cghooks update"
39+
]
40+
},
41+
"extra": {
42+
"hooks": {
43+
"pre-commit": [
44+
"./vendor/bin/pint --dirty",
45+
"git add -A"
46+
]
47+
}
48+
},
49+
"config": {
50+
"platform": {
51+
"php": "8.3.30"
52+
}
3153
}
3254
}

0 commit comments

Comments
 (0)