forked from jdp/redisent
-
Notifications
You must be signed in to change notification settings - Fork 144
60 lines (54 loc) · 1.67 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
name: CI
on: [push, pull_request]
jobs:
all:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- php-version: '7.4'
phpunit: '^7.5'
- php-version: '8.0'
phpunit: '^9'
- php-version: '8.1'
phpunit: '^9'
- php-version: '8.2'
phpunit: '^9'
name: PHP ${{ matrix.php-version }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: redis
- name: Setup Redis
run: sudo add-apt-repository ppa:redislabs/redis -y -u ; sudo apt install redis -y ; sudo systemctl stop redis\* ; redis-cli --version
- name: Install dependencies
env:
PHPUNIT_VERSION: ${{ matrix.phpunit }}
run: |
if [ ! -z "$PHPUNIT_VERSION" ]; then
composer require "phpunit/phpunit:${PHPUNIT_VERSION}" --dev --no-update -n
need_install_dev=1
fi
if php -r 'exit(version_compare(PHP_VERSION, "8.0") >= 0 ? 0 : 1);'; then
composer require "friendsofphp/php-cs-fixer:^3.13" --dev --no-update -n
need_install_dev=1
fi
if [ ! -z "$need_install_dev" ]; then
composer install --dev -n
fi
- name: Run PHP CS Fixer
env:
PHP_CS_FIXER_IGNORE_ENV: 1
run: |
if [ -f ./vendor/bin/php-cs-fixer ]; then
./vendor/bin/php-cs-fixer fix --diff --dry-run
fi
- name: Report phpredis version
run: php -r 'echo phpversion("redis")."\n";'
- name: Unit tests
run: ./vendor/bin/phpunit