-
Notifications
You must be signed in to change notification settings - Fork 1
79 lines (67 loc) · 2.05 KB
/
ci.yaml
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
name: Unit Tests
on:
pull_request:
push:
branches:
- master
concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}
env:
CI: true
REDIS_SERVER_HOST: '127.0.0.1'
REDIS_SERVER_PORT: 6379
MEMCACHED_POOL: '[["127.0.0.1",11211]]'
jobs:
tests:
runs-on: ubuntu-latest
name: PHP ${{ matrix.php }} with Redis v${{ matrix.redis }}
strategy:
fail-fast: false
matrix:
php:
- '8.1'
- '8.2'
redis:
- 5
- 6
- 7
services:
redis:
image: redis:${{ matrix.redis }}
options: --health-cmd="redis-cli ping" --health-retries=3 --health-interval=10s --health-timeout=5s
ports:
- 6379:6379
memcached:
image: memcached
ports:
- 11211:11211
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 10
- name: Setup PHP ${{ matrix.php }} with extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: redis, memcached, msgpack, igbinary, shmop, zip
ini-values: opcache.enable=0
tools: composer:v2
coverage: xdebug
- name: Install composer and update
uses: ramsey/composer-install@v2
with:
dependency-versions: highest
composer-options: '--no-progress --no-interaction'
- name: Run unit tests
if: ${{ matrix.php != '8.2' || matrix.redis != '7' }}
run: vendor/bin/phpunit
- name: Create coverage report
if: ${{ matrix.php == '8.2' && matrix.redis == '7' && github.repository == 'kodedphp/cache-simple' }}
run: vendor/bin/phpunit --coverage-clover build/clover.xml
- name: Send coverage
uses: sudo-bot/action-scrutinizer@latest
if: ${{ matrix.php == '8.2' && matrix.redis == '7' && github.repository == 'kodedphp/cache-simple' }}
with:
cli-args: "--format=php-clover build/clover.xml --revision=${{ github.sha }}"