-
-
Notifications
You must be signed in to change notification settings - Fork 205
72 lines (62 loc) · 2.16 KB
/
ci.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
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
on:
pull_request:
types: [opened, synchronize, reopened]
release:
types: [published]
push:
branches: [main]
name: CI
jobs:
coding-guidelines:
name: Coding Guidelines
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Update dependencies with composer
run: composer update --no-interaction --no-ansi --no-progress
- name: Run friendsofphp/php-cs-fixer
run: ./vendor/bin/php-cs-fixer fix --dry-run --show-progress=dots --using-cache=no --verbose
tests:
name: Tests - PHP${{ matrix.php-version }} [${{ startsWith(matrix.composer-flags, '--') && 'Low' || 'High' }}]
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ['7.2', '7.3', '7.4', '8.0', '8.1']
composer-flags: ["--prefer-lowest --prefer-stable", ""]
fail-fast: false
services:
redis:
image: redis
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Install PHP${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: apcu
coverage: xdebug
ini-values: apc.enabled=1,apc.enable_cli=1
- name: Checkout
uses: actions/checkout@master
- name: Update dependencies with composer
run: |
composer update --no-interaction --no-ansi --no-progress ${{ matrix.composer-flags }}
- name: Run tests
env:
REDIS_HOST: localhost
REDIS_PORT: ${{ job.services.redis.ports[6379] }}
run: XDEBUG_MODE=coverage ./vendor/bin/phpunit --coverage-clover=coverage.clover
- name: Upload coverage report to codecov
if: matrix.php-version == '7.3'
run: |
wget https://scrutinizer-ci.com/ocular.phar
php ocular.phar code-coverage:upload --format=php-clover coverage.clover
bash <(curl -s https://codecov.io/bash)