-
Notifications
You must be signed in to change notification settings - Fork 190
86 lines (70 loc) · 2.44 KB
/
php.yml
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
name: PHP QA
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
php:
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
php-version: ['7.4', '8.0', '8.1', '8.2', '8.3']
experimental: [false]
composer_args: [""]
include:
- php-version: 8.4
experimental: true
composer_args: "--ignore-platform-reqs"
steps:
- uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: xdebug
tools: php-cs-fixer
extensions: "ast, grpc, protobuf"
- name: Validate composer.json
run: composer validate
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-${{ matrix.php-version }}-php-${{ hashFiles('**/composer.json') }}
restore-keys: |
${{ runner.os }}-${{ matrix.php-version }}-php-
- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --prefer-dist --no-progress --no-suggest ${{ matrix.composer_args }}
- name: Check Style
continue-on-error: ${{ matrix.experimental }}
env:
PHP_CS_FIXER_IGNORE_ENV: 1
run: vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php --dry-run --stop-on-violation --using-cache=no -vvv
- name: Check Dependencies
run: vendor/bin/deptrac --formatter=github-actions --report-uncovered
- name: Run Phan
env:
XDEBUG_MODE: off
PHAN_DISABLE_XDEBUG_WARN: 1
run: vendor/bin/phan
- name: Run Psalm
run: vendor/bin/psalm --output-format=github
- name: Run Phpstan
run: vendor/bin/phpstan analyse --error-format=github
- name: Run PHPUnit (unit tests)
run: php -dzend.assertions=1 vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover --testsuite unit
- name: Run PHPUnit (integration tests)
run: vendor/bin/phpunit --testsuite integration
- name: Code Coverage
run: bash <(curl -s https://codecov.io/bash) -F ${{ matrix.php-version }}
packages:
uses: opentelemetry-php/gh-workflows/.github/workflows/validate-packages.yml@main
needs: php
with:
matrix_extension: '["ast, json, grpc"]'
install_directory: '~/.test/.packages'