Skip to content

Commit ad519a4

Browse files
committed
Add GitHub Actions for code style and tests
1 parent 5fc4e69 commit ad519a4

File tree

2 files changed

+81
-0
lines changed

2 files changed

+81
-0
lines changed

.github/workflows/fix-style.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Code Style
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
code-style:
11+
runs-on: ubuntu-latest
12+
13+
name: Code Style
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
with:
19+
token: ${{ secrets.GITHUB_TOKEN }}
20+
21+
- name: Setup PHP
22+
uses: shivammathur/setup-php@v2
23+
with:
24+
php-version: 8.2
25+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
26+
coverage: none
27+
28+
- name: Install dependencies
29+
run: composer update --prefer-dist --no-interaction
30+
31+
- name: Run Pint
32+
run: vendor/bin/pint
33+
34+
- name: Commit changes
35+
uses: stefanzweifel/git-auto-commit-action@v5
36+
with:
37+
commit_message: 'Fix code style with Laravel Pint'
38+
file_pattern: '*.php'

.github/workflows/run-tests.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
on:
2+
push:
3+
branches: [ master ]
4+
pull_request:
5+
branches: [ master ]
6+
7+
jobs:
8+
test:
9+
runs-on: ${{ matrix.os }}
10+
11+
strategy:
12+
fail-fast: true
13+
matrix:
14+
os: [ubuntu-latest, windows-latest, macos-latest]
15+
php: [8.2, 8.3, 8.4]
16+
laravel: [11.*, 12.*]
17+
stability: [prefer-lowest, prefer-stable]
18+
include:
19+
- laravel: 11.*
20+
testbench: ^9.0
21+
- laravel: 12.*
22+
testbench: ^10.0
23+
24+
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
25+
26+
steps:
27+
- name: Checkout code
28+
uses: actions/checkout@v4
29+
30+
- name: Setup PHP
31+
uses: shivammathur/setup-php@v2
32+
with:
33+
php-version: ${{ matrix.php }}
34+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
35+
coverage: none
36+
37+
- name: Install dependencies
38+
run: |
39+
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
40+
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
41+
42+
- name: Execute tests
43+
run: vendor/bin/pest --parallel

0 commit comments

Comments
 (0)