-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (51 loc) · 1.92 KB
/
Copy pathci.yml
File metadata and controls
63 lines (51 loc) · 1.92 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
name: CI
# On demand only: every push mailed a failing matrix to the maintainer.
on:
workflow_dispatch:
jobs:
test:
name: PHP ${{ matrix.php }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [ '8.3', '8.4', '8.5' ]
steps:
- uses: actions/checkout@v4
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mbstring
coverage: none
tools: composer:v2
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-interaction
- name: Lint
run: find src tests -name '*.php' -print0 | xargs -0 -n1 -P4 php -l > /dev/null
- name: JavaScript smoke test
# The PHP suite never executes a line of the script, so a reference
# that does not resolve is invisible to it — and the failure mode is
# every module after it silently not running.
run: composer test:js
- name: Coding standards
run: composer lint
- name: Formatting
# Separate from the lint: a clean lint does not mean a clean format
# check, and a green build has to mean both.
run: composer format:check
- name: Documentation
# The examples are checked against the registry: a configuration key
# nothing reads is not an error in PHP, so the only symptom of one is
# a documented option that quietly does nothing.
run: composer docs:verify
- name: Tests
# set -o pipefail, because a pipeline reports its last command and tee
# always succeeds -- without it a failing suite exits 0 and reads green.
run: |
set -o pipefail
composer test | tee phpunit.log
grep -qE 'OK \(|Tests: ' phpunit.log || {
echo '::error::phpunit produced no result -- the suite did not run'
exit 1
}