Skip to content

Commit 31c23bd

Browse files
committed
Add github actions
1 parent 94f5be7 commit 31c23bd

File tree

3 files changed

+109
-0
lines changed

3 files changed

+109
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Fix PHP code style issues
2+
3+
on:
4+
push:
5+
paths:
6+
- '**.php'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
php-code-styling:
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 5
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
with:
20+
ref: ${{ github.head_ref }}
21+
22+
- name: Fix PHP code style issues
23+
uses: aglipanci/[email protected]
24+
25+
- name: Commit changes
26+
uses: stefanzweifel/git-auto-commit-action@v5
27+
with:
28+
commit_message: Fix styling

.github/workflows/phpstan.yml

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

.github/workflows/run-tests.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: run-tests
2+
3+
on:
4+
- push
5+
- pull_request
6+
7+
jobs:
8+
test:
9+
runs-on: ${{ matrix.os }}
10+
timeout-minutes: 5
11+
strategy:
12+
fail-fast: true
13+
matrix:
14+
os: [ubuntu-latest]
15+
php: [8.3, 8.2, 8.1]
16+
laravel: [11.*, 10.*]
17+
stability: [prefer-stable]
18+
include:
19+
- laravel: 10.*
20+
testbench: ^8.8
21+
- laravel: 11.*
22+
testbench: ^9.0
23+
exclude:
24+
- laravel: 11.*
25+
php: 8.1
26+
27+
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
28+
29+
steps:
30+
- name: Checkout code
31+
uses: actions/checkout@v4
32+
33+
- name: Setup PHP
34+
uses: shivammathur/setup-php@v2
35+
with:
36+
php-version: ${{ matrix.php }}
37+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
38+
coverage: none
39+
40+
- name: Setup problem matchers
41+
run: |
42+
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
43+
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
44+
45+
- name: Install dependencies
46+
run: |
47+
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
48+
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
49+
50+
- name: List Installed Dependencies
51+
run: composer show -D
52+
53+
- name: Execute tests
54+
run: vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover

0 commit comments

Comments
 (0)