Repository navigation
53 lines (44 loc) · 1.5 KB
/
Copy pathphp.yml
File metadata and controls
53 lines (44 loc) · 1.5 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
name: PHP package checks
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
workflow_dispatch:
permissions:
contents: read
jobs:
verify:
name: PHP ${{ matrix.php }}
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
php: ['8.1', '8.2', '8.3', '8.4', '8.5']
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: curl, intl, mbstring, pdo_sqlite
tools: composer:v2
github-token: ${{ secrets.GITHUB_TOKEN }}
coverage: none
- name: Validate Composer manifest
run: composer validate --no-check-publish --no-check-lock --no-interaction
- name: Resolve and install dependencies
run: composer update --prefer-dist --no-interaction --no-progress --no-scripts
- name: Check PHP syntax
run: find . -path './vendor' -prune -o -path './.git' -prune -o -name '*.php' -type f -print0 | xargs -0 -n1 php -l
- name: Run declared tests
shell: bash
run: |
if php -r '$composer = json_decode(file_get_contents("composer.json"), true); exit(isset($composer["scripts"]["test"]) ? 0 : 1);'; then
composer test --no-interaction
else
echo 'No test script is declared for this package.'
fi
- name: Audit dependencies
run: composer audit --abandoned=report