-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (52 loc) · 1.85 KB
/
php-code-check.yml
File metadata and controls
64 lines (52 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# GithHub Actions Workflow generated with Ghygen
# Original configuration: https://ghygen.hi-folks.dev?code=354d36d61f68289bf7e40c41c6a5a1f1
name: Template - Laravel package
on:
push:
branches:
- main
- develop
- features/**
jobs:
laravel-tests:
runs-on: ubuntu-latest
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: [ '8.0','7.4','7.3' ]
dependency-stability: [ prefer-stable ]
laravel: [ '8.*','7.*' ]
include:
- laravel: 8.*
testbench: 6.*
- laravel: 7.*
testbench: 5.*
name: P${{ matrix.php-versions }} - L${{ matrix.laravel }} - ${{ matrix.dependency-stability }} - ${{ matrix.operating-system}}
steps:
- uses: actions/checkout@v2
- name: Install PHP versions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
- name: Install Laravel Dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --${{ matrix.dependency-stability }} --prefer-dist --no-interaction --no-suggest
- name: Show dir
run: pwd
- name: PHP Version
run: php --version
# Code quality
- name: Execute tests (Unit and Feature tests) via PHPUnit
# Set environment
env:
SESSION_DRIVER: array
run: vendor/bin/phpunit --testdox
- name: Execute Code Sniffer via phpcs
run: |
composer require --dev squizlabs/php_codesniffer
vendor/bin/phpcs --standard=PSR12 src
- name: Execute Code Static Analysis (PHP Stan + Larastan)
run: |
composer require --dev nunomaduro/larastan
vendor/bin/phpstan analyse src -c ./vendor/nunomaduro/larastan/extension.neon --level=4 --no-progress