-
Notifications
You must be signed in to change notification settings - Fork 18
76 lines (62 loc) · 1.93 KB
/
Copy pathci.yml
File metadata and controls
76 lines (62 loc) · 1.93 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
name: CI
on:
push:
branches:
- master
- develop
- stage
pull_request:
workflow_dispatch:
schedule:
# Weekly run to catch breakage from new PHP / dependency releases.
- cron: '0 6 * * 1'
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
tests:
name: PHP ${{ matrix.php }}${{ matrix.deps == 'lowest' && ' (lowest deps)' || '' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['8.1', '8.2', '8.3', '8.4', '8.5']
deps: ['highest']
include:
# Also verify the project still works against its minimum dependencies.
- php: '8.1'
deps: 'lowest'
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: soap, curl, libxml, openssl, mbstring
coverage: xdebug
ini-values: error_reporting=E_ALL, display_errors=On
- name: Validate composer.json
run: composer validate --strict
- name: Install dependencies
run: >
composer update --no-interaction --no-progress --prefer-dist
${{ matrix.deps == 'lowest' && '--prefer-lowest --prefer-stable' || '--prefer-stable' }}
- name: Lint (php syntax)
run: composer lint
- name: Coding standards (PSR-2)
run: composer check-style
- name: Static analysis (PHPStan)
run: composer stan
- name: Tests (hermetic + TLS)
run: vendor/bin/phpunit --coverage-clover=coverage.xml --colors=never
- name: Upload coverage to Codecov
if: matrix.php == '8.3' && matrix.deps == 'highest'
uses: codecov/codecov-action@v7
with:
files: coverage.xml
fail_ci_if_error: false
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}