forked from lecterror/cakephp-filter-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (74 loc) · 2.57 KB
/
pull-request.yml
File metadata and controls
80 lines (74 loc) · 2.57 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: CI
run-name: Pull to ${{ github.base_ref }} by ${{ github.actor }}
on:
pull_request:
branches: [master, develop, 3.x]
jobs:
Unit-Tests:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ['5.6', '7.1', '7.2', '7.3', '7.4']
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
- name: Setup MySQL
uses: shogo82148/actions-setup-mysql@v1
with:
mysql-version: '5.6'
- name: Check out repository code
uses: actions/checkout@v3
- name: Install Dependencies
run: |
composer remove --dev phpstan/phpstan cakephp/cakephp-codesniffer overtrue/phplint --no-update
composer require 'cakephp/cakephp=3.10.5' 'phpunit/phpunit=5.7.0' --with-all-dependencies
shell: bash
- name: Create test database
run: mysql -u root -e "CREATE DATABASE cakephp_test"
shell: bash
- name: Unit Tests
run: ./vendor/bin/phpunit ./tests
PHP-Lint:
runs-on: ubuntu-latest
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
- name: Check out repository code
uses: actions/checkout@v3
- name: Install PHPLint
run: composer require --dev overtrue/phplint
- name: Run PHPLint
run: vendor/bin/phplint
PHPStan:
runs-on: ubuntu-latest
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
- name: Check out repository code
uses: actions/checkout@v3
- name: Install Dependencies
run: composer require 'cakephp/cakephp=3.10.5' 'phpunit/phpunit=7.0' phpstan/phpstan phpstan/phpstan-phpunit --with-all-dependencies
- name: PHPStan
run: vendor/bin/phpstan analyse --level=8 ./src ./tests
PHP-Code-Sniffer:
runs-on: ubuntu-latest
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 5.6
- name: Check out repository code
uses: actions/checkout@v3
- name: Install PHPCS
run: |
composer remove --dev phpstan/phpstan phpunit/phpunit overtrue/phplint --no-update
composer require cakephp/cakephp-codesniffer
vendor/bin/phpcs --config-set installed_paths /home/runner/work/cakephp-filter-plugin/cakephp-filter-plugin/vendor/cakephp/cakephp-codesniffer
- name: Run PHPCS
run: vendor/bin/phpcs --colors --parallel=16 -p --standard=CakePHP --extensions=php,ctp src/ tests/