Repository navigation
91 lines (73 loc) · 1.9 KB
/
Copy pathbuild.yml
File metadata and controls
91 lines (73 loc) · 1.9 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
name: Build
on:
push:
branches:
- '8.*.x'
- develop
- main
paths-ignore:
- 'README.md'
- 'docs/**'
pull_request:
branches:
- '8.*.x'
- develop
- main
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
php:
name: Resolve PHP versions
runs-on: ubuntu-latest
outputs:
versions: ${{ steps.php.outputs.versions }}
steps:
# Each "8.N.x" branch targets exactly PHP 8.N; any other branch uses the 8.5 baseline.
- name: Resolve PHP versions from branch
id: php
shell: bash
run: |
BRANCH="${GITHUB_BASE_REF:-${GITHUB_REF_NAME}}"
if [[ "${BRANCH}" =~ ^8\.[0-9]+\.x$ ]]; then
VERSIONS="[\"${BRANCH%.x}\"]"
else
VERSIONS='["8.5"]'
fi
echo "branch=${BRANCH} php=${VERSIONS}"
echo "versions=${VERSIONS}" >> "$GITHUB_OUTPUT"
tests:
name: PHP ${{ matrix.php }} - ${{ matrix.dependencies }}
needs: php
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ${{ fromJSON(needs.php.outputs.versions) }}
dependencies:
- lowest
- highest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
tools: composer:v2
- name: Validate Composer
run: composer validate --strict
- name: Install dependencies
uses: ramsey/composer-install@v4
with:
dependency-versions: ${{ matrix.dependencies }}
- name: Run tests
run: composer test
- name: PHPStan
run: composer analyse -- --no-progress
- name: Coding style
run: composer lint