-
-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (85 loc) · 2.25 KB
/
tests.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
87
88
name: Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
phpcs:
name: PHP Coding Style
runs-on: ubuntu-latest
steps:
-
name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.3"
tools: php-cs-fixer
coverage: none
-
name: Checkout
uses: actions/checkout@v4
-
name: Run PHP-CS-Fixer
run: php-cs-fixer check --ansi --no-interaction --using-cache=no --diff --show-progress=none
phpunit:
name: PHPUnit
needs:
- phpcs
strategy:
matrix:
include:
-
os: ubuntu-latest
php-version: "7.4"
-
os: ubuntu-latest
php-version: "8.0"
coverage: xdebug
phpunit-options: --coverage-clover coverage.xml
-
os: ubuntu-latest
php-version: "8.1"
-
os: ubuntu-latest
php-version: "8.2"
-
os: ubuntu-latest
php-version: "8.3"
-
os: windows-latest
php-version: "7.4"
-
os: windows-latest
php-version: "8.3"
runs-on: ${{ matrix.os }}
steps:
-
name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: composer
coverage: ${{ matrix.coverage }}
extensions: intl
-
name: Checkout
uses: actions/checkout@v4
-
name: Install Composer dependencies
run: composer update --ansi --no-interaction --no-progress
-
name: Run PHPUnit
run: composer run-script test --ansi --no-interaction -- ${{ matrix.phpunit-options }}
-
name: Download Coveralls
if: matrix.coverage
run: curl -sSLf -o php-coveralls.phar https://github.com/php-coveralls/php-coveralls/releases/download/v2.7.0/php-coveralls.phar
-
name: Upload coverage
if: matrix.coverage
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: php php-coveralls.phar --ansi --no-interaction --coverage_clover=coverage.xml --json_path=coverage.json -v