-
Notifications
You must be signed in to change notification settings - Fork 1
82 lines (69 loc) · 2.17 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
name: 'php'
on:
pull_request:
paths:
- '**/*.php'
- '.github/workflows/php.yml'
- '**/composer.json'
push:
paths:
- '**/*.php'
- '.github/workflows/php.yml'
- '**/composer.json'
jobs:
cs:
uses: bedita/github-workflows/.github/workflows/php-cs.yml@v2
with:
php_versions: '["8.3"]'
stan:
uses: bedita/github-workflows/.github/workflows/php-stan.yml@v2
with:
php_versions: '["8.3"]'
unit:
name: 'Run unit tests'
if: "!contains(github.event.commits[0].message, '[skip ci]') && !contains(github.event.commits[0].message, '[ci skip]')"
runs-on: 'ubuntu-latest'
strategy:
fail-fast: false
matrix:
php:
- '8.2'
- '8.3'
env:
PHP_VERSION: '${{ matrix.php }}'
steps:
- name: 'Checkout current revision'
uses: 'actions/checkout@v4'
- name: 'Setup PHP'
uses: 'shivammathur/setup-php@v2'
with:
php-version: '${{ matrix.php }}'
tools: 'composer'
extensions: 'mbstring, intl'
coverage: 'pcov'
ini-values: 'pcov.directory=., pcov.exclude="~vendor~"'
- name: 'Discover Composer cache directory'
id: 'cachedir'
run: 'echo "::set-output name=path::$(composer global config cache-dir)"'
- name: 'Share Composer cache across runs'
uses: 'actions/cache@v4'
with:
path: '${{ steps.cachedir.outputs.path }}'
key: "composer-${{ matrix.php }}-${{ hashFiles('**/composer.json') }}"
restore-keys: |
composer-${{ matrix.php }}-
composer-
- name: 'Install dependencies with Composer'
run: 'composer install --prefer-dist --no-interaction'
- name: 'Run PHPUnit with coverage'
run: 'vendor/bin/phpunit --coverage-clover=clover.xml'
- name: 'Export coverage results'
uses: 'codecov/codecov-action@v4'
with:
file: './clover.xml'
env_vars: PHP_VERSION,DB_VENDOR
- name: 'Archive code coverage results'
uses: 'actions/upload-artifact@v4'
with:
name: 'PHP ${{ matrix.php }}'
path: 'clover.xml'