-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (74 loc) · 2.5 KB
/
ci.yml
File metadata and controls
92 lines (74 loc) · 2.5 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: CI
on:
push:
pull_request:
branches:
- '*'
jobs:
testsuite:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
php-version: ['8.2', '8.3', '8.4']
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, intl
coverage: pcov
- name: Cache composer dependencies
uses: actions/cache@v4
with:
path: ~/.composer/cache
key: ${{ runner.os }}-composer-${{ hashFiles('composer.json') }}
- name: composer install
run: composer install --prefer-dist --no-progress
- name: Setup problem matchers for PHPUnit
if: matrix.php-version == '8.2' && matrix.os == 'ubuntu-latest'
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Run PHPUnit with coverage
if: matrix.php-version == '8.2' && matrix.os == 'ubuntu-latest'
run: |
export CODECOVERAGE=1
vendor/bin/phpunit --configuration=phpunit.xml --display-deprecations --display-incomplete --display-skipped --coverage-clover=coverage.xml
- name: Run PHPUnit without coverage
if: matrix.php-version != '8.2' || matrix.os != 'ubuntu-latest'
run: vendor/bin/phpunit --configuration=phpunit.xml
- name: Submit code coverage
if: matrix.php-version == '8.2' && matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v3
cs-stan:
name: Coding Standard & Static Analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: mbstring, intl
coverage: none
tools: phive
- name: Cache composer dependencies
uses: actions/cache@v4
with:
path: ~/.composer/cache
key: ${{ runner.os }}-composer-${{ hashFiles('composer.json') }}
- name: composer install
run: composer install --prefer-dist --no-progress
- name: Install phive
run: |
wget -O phive.phar https://phar.io/releases/phive.phar
chmod +x phive.phar
sudo mv phive.phar /usr/local/bin/phive
- name: Install PHP tools with phive
run: |
phive install --trust-gpg-keys CF1A108D0E7AE720,51C67305FFC2E5C0,12CE0F1D262429A5
- name: Run PHP CodeSniffer
run: composer cs-check
- name: Run phpstan
run: composer stan