-
Notifications
You must be signed in to change notification settings - Fork 4
147 lines (127 loc) · 3.71 KB
/
pull-request.yml
File metadata and controls
147 lines (127 loc) · 3.71 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: Pull Request
on:
pull_request:
jobs:
build:
name: PHP ${{ matrix.php-versions }}
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['8.1', '8.5']
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl, sqlite3, xml, simplexml, mysqli
tools: composer:v2
- name: Matrix PHP Version
run: |
echo ${{ matrix.php-versions }}
php -v
- name: Composer Check
run: composer validate
- name: Install
run: |
composer install --prefer-dist --no-interaction --no-progress
composer update
cp config/.env.example config/.env
cp config/app_local.example.php config/app_local.php
- name: Test Suite + Static Analysis
if: ${{ matrix.php-versions}}
run: |
composer analyze
coverage:
name: PHP ${{ matrix.php-versions }} w/ Coverage Report
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['8.1']
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl, sqlite3, xml, simplexml, mysqli
tools: composer:v2
coverage: xdebug
- name: Composer Check
run: composer validate
- name: Install
run: |
composer install --prefer-dist --no-interaction --no-progress
composer update
cp config/.env.example config/.env
cp config/app_local.example.php config/app_local.php
- name: Coverage Report
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
composer global require php-coveralls/php-coveralls
export CODECOVERAGE=1 && vendor/bin/phpunit --coverage-clover=clover.xml
php-coveralls --coverage_clover=clover.xml -v
#
# Test plugins individually
#
plugins:
name: ${{ matrix.plugin }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
plugin: [
'bake',
'collection-view',
'crud',
'exception-render',
'hal-view',
'json-ld-view',
'jwt-auth'
]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: mbstring, intl, sqlite3, xml, simplexml, mysqli
- name: PHP Version
run: php -v
- name: ${{matrix.plugin}} tests
run: |
cp config/.env.example config/.env
cp plugins/${{matrix.plugin}}/composer.json .
rm -rf composer.lock
composer install
vendor/bin/phpunit plugins/${{matrix.plugin}}
#
# CakePHP version compatability
#
cakephp_version_compatibility:
name: CakePHP ${{ matrix.version }} Test
runs-on: ubuntu-latest
strategy:
matrix:
version: ['~5.0.0', '^5.0']
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: mbstring, intl
- name: PHP Version
run: php -v
- name: CakePHP ${{matrix.version}} Compatability
run: |
composer self-update
rm -rf composer.lock
composer require cakephp/cakephp:${{matrix.version}} --no-update
composer install --prefer-dist --no-progress
composer test