-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (80 loc) · 2.28 KB
/
php-lint.yaml
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
name: PHP Lint
on:
workflow_call:
inputs:
PROJECT:
type: string
required: true
PATH:
type: string
required: false
default: .
COMPOSER_PATH:
type: string
required: false
default: .
COMPOSER_PHP_VERSION:
type: string
required: false
default: "7.4"
COMPOSER_VERSION:
type: string
required: false
default: "1.x"
COMPOSER_DEV:
type: string
required: false
default: "no"
COMPOSER_MEMORY_LIMIT:
type: string
required: false
default: "256M"
PHP_EXTENSIONS:
type: string
required: false
default: "amqp"
PHPCS_PATH:
type: string
required: false
default: .
FLAVOUR:
type: string
required: false
default: phpcs
description: "one of phpcs, phpstan"
secrets:
SSH_KEY:
required: false
SSH_KEY_PUB:
required: false
jobs:
php-lint:
runs-on: ubuntu-22.04
steps:
- name: checkout
uses: actions/[email protected]
- name: Cache Composer dependencies
uses: actions/[email protected]
with:
path: /tmp/composer-cache
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
- uses: php-actions/[email protected]
with:
php_version: ${{inputs.COMPOSER_PHP_VERSION}}
version: ${{inputs.COMPOSER_VERSION}}
args: "--ignore-platform-reqs --working-dir ${{inputs.COMPOSER_PATH}}"
php_extensions: ${{inputs.PHP_EXTENSIONS}}
dev: ${{inputs.COMPOSER_DEV}}
ssh_key: ${{secrets.SSH_KEY}}
ssh_key_pub: ${{secrets.SSH_KEY_PUB}}
memory_limit: ${{inputs.COMPOSER_MEMORY_LIMIT}}
- uses: php-actions/[email protected]
with:
path: ${{inputs.PATH}}
memory_limit: ${{inputs.COMPOSER_MEMORY_LIMIT}}
if: inputs.FLAVOUR == 'phpstan'
- name: phpcs
uses: docker://docker.io/cytopia/phpcs:3@sha256:f1e6e93e9ce6be79e6d27c42b8cdfb7a07255275281e8db961ad3c6f0c1de5d0 # https://hub.docker.com/r/cytopia/phpcs
with:
args: --standard=${{inputs.PATH}}/phpcs.xml.dist ${{inputs.PHPCS_PATH}}
if: inputs.FLAVOUR == 'phpcs'