Skip to content

Commit e1792be

Browse files
authored
Create php.yml
1 parent 33c9ae5 commit e1792be

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

.github/workflows/php.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: PHP Composer
2+
3+
on:
4+
push:
5+
branches: [ master, dev ]
6+
pull_request:
7+
branches: [ master, dev ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
17+
# Setup PHP versions, run checks
18+
- name: PHP setup
19+
uses: shivammathur/setup-php@v2
20+
with:
21+
php-version: 8
22+
23+
- name: Validate composer.json and composer.lock
24+
run: composer validate
25+
26+
- name: Cache Composer packages
27+
id: composer-cache
28+
uses: actions/cache@v2
29+
with:
30+
path: vendor
31+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
32+
restore-keys: |
33+
${{ runner.os }}-php-
34+
- name: Install dependencies
35+
if: steps.composer-cache.outputs.cache-hit != 'true'
36+
run: composer install --prefer-dist --no-progress --no-suggest
37+
38+
- name: Run test
39+
run: composer run-script phpunit
40+
41+
- name: Run phpstan
42+
run: composer run-script phpstan
43+
44+
- name: Check codestyle
45+
run: composer run-script phpcs

0 commit comments

Comments
 (0)