Skip to content

Commit 158b9aa

Browse files
committed
Add workflows
1 parent 8bf00b4 commit 158b9aa

File tree

2 files changed

+75
-0
lines changed

2 files changed

+75
-0
lines changed

.github/workflows/run-cs-fix.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: run-cs-fix
2+
3+
on:
4+
push:
5+
6+
jobs:
7+
lint:
8+
runs-on: ubuntu-latest
9+
strategy:
10+
fail-fast: true
11+
matrix:
12+
php: [8.3]
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Setup PHP
19+
uses: shivammathur/setup-php@v2
20+
with:
21+
php-version: ${{ matrix.php }}
22+
extensions: json, dom, curl, libxml, mbstring
23+
coverage: none
24+
25+
- name: Install Pint
26+
run: composer global require laravel/pint
27+
28+
- name: Run Pint
29+
run: pint
30+
31+
- name: Commit linted files
32+
uses: stefanzweifel/git-auto-commit-action@v5
33+
with:
34+
commit_message: "Fix code style"

.github/workflows/run-tests.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: run-tests
2+
3+
on:
4+
push:
5+
pull_request:
6+
schedule:
7+
- cron: "0 0 * * *"
8+
9+
jobs:
10+
run-tests:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
os: [ ubuntu-latest ]
16+
php: [ 8.3, 8.2, 8.1 ]
17+
dependency-version: [ prefer-stable ]
18+
19+
name: ${{ matrix.os }} - P${{ matrix.php }} - ${{ matrix.dependency-version }}
20+
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v4
24+
25+
- name: Cache dependencies
26+
uses: actions/cache@v4
27+
with:
28+
path: ~/.composer/cache/files
29+
key: dependencies-laravel-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
30+
31+
- name: Setup PHP
32+
uses: shivammathur/setup-php@v2
33+
with:
34+
php-version: ${{ matrix.php }}
35+
36+
- name: Install dependencies
37+
run: |
38+
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
39+
40+
- name: Execute tests
41+
run: vendor/bin/pest

0 commit comments

Comments
 (0)