-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (83 loc) · 2.99 KB
/
php.yml
File metadata and controls
88 lines (83 loc) · 2.99 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
# This workflow orchestrates PHP linting, unit testing, and static analysis across multiple PHP versions.
# It accepts PHP versions, extensions, and dependencies as inputs to configure each job dynamically.
on:
workflow_call:
inputs:
php-versions:
type: string
description: 'PHP versions to test against, JSON encoded array of strings.'
default: '["8.2", "8.3", "8.4", "8.5"]'
php-extensions:
type: string
description: 'PHP extensions to install, comma separated list of strings.'
dependencies:
type: string
description: 'Dependencies to install, JSON encoded map of path => repository url.'
default: '{}'
env:
type: string
description: 'Environment variables to set, JSON encoded map of name => value.'
default: '{}'
databases:
type: boolean
description: 'Enable database support for unit tests.'
phpunit-version:
type: string
description: 'PHPUnit version to use.'
default: 'latest'
setup-commands:
description: 'Custom setup commands (one per line)'
type: string
working-directory:
type: string
default: .
# Prevent multiple runs of the same workflow from overlapping on the same branch/PR.
concurrency:
group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: Lint
strategy:
fail-fast: false
matrix:
php: ${{ fromJson(inputs.php-versions) }}
uses: ./.github/workflows/php-lint.yml
with:
php-version: ${{ matrix.php }}
setup-commands: ${{ inputs.setup-commands }}
working-directory: ${{ inputs.working-directory }}
test:
name: Test
strategy:
fail-fast: false
matrix:
php: ${{ fromJson(inputs.php-versions) }}
uses: ./.github/workflows/php-unit.yml
with:
php-version: ${{ matrix.php }}
php-extensions: ${{ inputs.php-extensions }}
dependencies: ${{ inputs.dependencies }}
env: ${{ inputs.env }}
databases: ${{ inputs.databases }}
phpunit-version: ${{ inputs.phpunit-version }}
setup-commands: ${{ inputs.setup-commands }}
working-directory: ${{ inputs.working-directory }}
stan:
name: Static analysis
strategy:
fail-fast: false
matrix:
php: ${{ fromJson(inputs.php-versions) }}
uses: ./.github/workflows/php-sa.yml
with:
php-version: ${{ matrix.php }}
php-extensions: ${{ inputs.php-extensions }}
dependencies: ${{ inputs.dependencies }}
env: ${{ inputs.env }}
setup-commands: ${{ inputs.setup-commands }}
working-directory: ${{ inputs.working-directory }}
# GitHub does not yet support continue-on-error at the job level for jobs invoking reusable workflows
# (see https://github.com/orgs/community/discussions/77915, for example).
# This workaround enables the reusable workflow to handle errors internally instead.
continue-on-error: true