-
Notifications
You must be signed in to change notification settings - Fork 20
108 lines (88 loc) · 2.64 KB
/
Copy pathci.yml
File metadata and controls
108 lines (88 loc) · 2.64 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: CI
on:
push:
pull_request:
defaults:
run:
shell: bash
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: read
jobs:
tests:
name: Tests
env:
extensions: mbstring
strategy:
matrix:
include:
- php: '7.1'
- php: '7.2'
- php: '7.3'
- php: '7.4'
deps: 'low'
- php: '7.4'
deps: 'psr-http-message-v1'
coverage: 'yes'
phpcs: 'yes'
- php: '8.0'
- php: '8.1'
- php: '8.2'
- php: '8.3'
- php: '8.4'
- php: '8.5'
fail-fast: false
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
coverage: "xdebug"
ini-values: date.timezone=Europe/Kiev,memory_limit=-1,default_socket_timeout=10,session.gc_probability=0,apc.enable_cli=1,zend.assertions=1
php-version: "${{ matrix.php }}"
extensions: "${{ env.extensions }}"
tools: composer:v2
- name: Configure environment
run: |
php -v
mkdir -p build/logs
- name: Install dependencies
if: "matrix.deps != 'low'"
run: |
composer i -o -q --no-suggest
- name: Install dependencies (low)
if: "matrix.deps == 'low'"
run: |
composer u -o -q --no-suggest --prefer-lowest
- name: Install psr/http-message v1
if: "matrix.deps == 'psr-http-message-v1'"
run: |
composer u psr/http-message -o -q --no-suggest --prefer-lowest
- name: Run phpcs
if: "matrix.phpcs == 'yes'"
run: |
composer phpcs
- name: Run PHPUnit
if: "matrix.coverage != 'yes'"
run: |
vendor/bin/phpunit
- name: Run PHPUnit with coverage report
if: "matrix.coverage == 'yes'"
run: |
vendor/bin/phpunit --coverage-clover build/logs/clover.xml
- name: Send coverage
if: "matrix.coverage == 'yes'"
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: true
COVERALLS_FLAG_NAME: "PHP ${{ matrix.php }}"
run: |
composer require "php-coveralls/php-coveralls:~2.5"
php vendor/bin/php-coveralls -v
curl -k https://coveralls.io/webhook?repo_token=${{ secrets.GITHUB_TOKEN }} -d "repo_name=$GITHUB_REPOSITORY&payload[build_num]=$GITHUB_RUN_ID&payload[status]=done"