-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (44 loc) · 1.49 KB
/
Copy pathci.yml
File metadata and controls
55 lines (44 loc) · 1.49 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
name: CI
# On demand only: every push mailed a failing matrix to the maintainer.
on:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
tests:
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: 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: Tests
# Checked for output, not just exit status. Anything that exits during
# autoload takes phpunit with it before it runs, and the step passes
# with status 0 having tested nothing.
run: |
composer test | tee phpunit.log
grep -qE 'OK \(|Tests: ' phpunit.log || {
echo '::error::phpunit produced no result -- the suite did not run'
exit 1
}