-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (88 loc) · 2.61 KB
/
Copy pathplugin-ci.yml
File metadata and controls
102 lines (88 loc) · 2.61 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
name: Reusable plugin CI
on:
workflow_call:
inputs:
php-version:
type: string
default: '8.3'
timeout-minutes:
type: number
default: 15
bun-install:
type: boolean
default: false
composer-install:
type: boolean
default: true
composer-validate:
type: boolean
default: true
php-lint-command:
type: string
default: ''
php-analyze-command:
type: string
default: ''
bun-lint-command:
type: string
default: ''
test-command:
type: string
default: ''
build-command:
type: string
default: ''
permissions:
contents: read
jobs:
checks:
name: Run checks
runs-on: ubuntu-latest
timeout-minutes: ${{ inputs.timeout-minutes }}
steps:
- name: Check out repository
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Set up PHP
uses: shivammathur/setup-php@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc # 2.37.1
with:
php-version: ${{ inputs.php-version }}
coverage: none
- name: Set up Bun
if: ${{ inputs.bun-install }}
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
- name: Install Composer dependencies
if: ${{ inputs.composer-install }}
run: composer install --no-interaction --prefer-dist
- name: Install Bun dependencies
if: ${{ inputs.bun-install }}
run: bun install --frozen-lockfile
- name: Validate Composer configuration
if: ${{ inputs.composer-install && inputs.composer-validate }}
run: composer validate --strict
- name: Lint PHP
if: ${{ inputs.php-lint-command != '' }}
env:
PHP_LINT_COMMAND: ${{ inputs.php-lint-command }}
run: eval "$PHP_LINT_COMMAND"
- name: Analyze PHP
if: ${{ inputs.php-analyze-command != '' }}
env:
PHP_ANALYZE_COMMAND: ${{ inputs.php-analyze-command }}
run: eval "$PHP_ANALYZE_COMMAND"
- name: Lint assets
if: ${{ inputs.bun-lint-command != '' }}
env:
BUN_LINT_COMMAND: ${{ inputs.bun-lint-command }}
run: eval "$BUN_LINT_COMMAND"
- name: Run tests
if: ${{ inputs.test-command != '' }}
env:
TEST_COMMAND: ${{ inputs.test-command }}
run: eval "$TEST_COMMAND"
- name: Build assets
if: ${{ inputs.build-command != '' }}
env:
BUILD_COMMAND: ${{ inputs.build-command }}
run: eval "$BUILD_COMMAND"