-
-
Notifications
You must be signed in to change notification settings - Fork 366
106 lines (100 loc) · 3.72 KB
/
ci.yml
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
name: CI
on:
push:
branches: ['master']
pull_request:
branches: ['*']
schedule:
- cron: '0 0 * * *'
jobs:
php-tests:
name: Tests - PHP ${{ matrix.php }} ${{ matrix.dependency-version }}
runs-on: ubuntu-22.04
timeout-minutes: 15
strategy:
matrix:
php: [ '8.4', '8.3', '8.2', '8.1', '8.0' ]
dependency-version: [ '' ]
platform-reqs: [ '' ]
include:
- php: '8.0'
dependency-version: '--prefer-lowest'
steps:
- name: Checkout
uses: actions/checkout@v4
# Node is required by some tests
- uses: actions/setup-node@v3
with:
node-version: 18
# serverless is required by some tests
- name: Install serverless
run: npm i -g serverless@3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2
coverage: none
ini-values: expose_php=1
- name: Install dependencies
run: 'composer update ${{ matrix.dependency-version }} --no-interaction --prefer-dist --no-progress ${{ matrix.platform-reqs }}'
- name: Execute Unit Tests
run: 'vendor/bin/phpunit --testsuite small'
phpstan:
runs-on: ubuntu-22.04
name: PHPStan
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
tools: composer:v2, cs2pr
coverage: none
- name: Cache Composer dependencies
uses: actions/cache@v3
with:
path: ~/.composer/cache
key: php-composer-locked-${{ hashFiles('composer.lock') }}
restore-keys: php-composer-locked-
- name: Install dependencies
run: composer install --no-interaction --prefer-dist --no-progress
- name: PHPStan
run: vendor/bin/phpstan analyse --error-format=checkstyle | cs2pr
phpcs:
runs-on: ubuntu-22.04
name: PHP CodeSniffer
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
tools: composer:v2, cs2pr
coverage: none
- name: Cache Composer dependencies
uses: actions/cache@v3
with:
path: ~/.composer/cache
key: php-composer-locked-${{ hashFiles('composer.lock') }}
restore-keys: php-composer-locked-
- name: Install dependencies
run: composer install --no-interaction --prefer-dist --no-progress
- name: PHP CS
run: vendor/bin/phpcs -q --no-colors --report=checkstyle | cs2pr
js-lint:
runs-on: ubuntu-22.04
name: JS type validation and linting
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 18
- uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
- run: npm i
- run: npm run lint