-
Notifications
You must be signed in to change notification settings - Fork 81
98 lines (87 loc) · 2.38 KB
/
Copy pathci.yml
File metadata and controls
98 lines (87 loc) · 2.38 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
name: CI
on:
pull_request: ~
push:
branches:
- master
jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['7.4', '8.0', '8.1']
services:
redis:
image: redis:6.0.0
ports:
- 6379:6379
redis-cluster:
image: grokzen/redis-cluster:5.0.4
ports:
- 7000:7000
- 7001:7001
- 7002:7002
env:
STANDALONE: 1
memcached:
image: memcached:1.6.5
ports:
- 11211:11211
mongodb:
image: mongo
ports:
- 27017:27017
steps:
- name: Set up PHP
uses: shivammathur/setup-php@2.7.0
with:
php-version: ${{ matrix.php }}
coverage: none
tools: pecl
extensions: redis, memcached, mongodb, apcu, apc
ini-values: apc.enable_cli=1
- name: Checkout code
uses: actions/checkout@v2
- name: Download dependencies
env:
PHP_VERSION: ${{ matrix.php }}
run: |
CURRENT_DIR=$(pwd)
ok=0
for PACKAGE in $(find src -maxdepth 4 -type f -name phpunit.xml.dist -printf '%h\n' | sort)
do
echo ::group::$PACKAGE
echo "$CURRENT_DIR/$PACKAGE"
cd "$CURRENT_DIR/$PACKAGE"
localExit=0
if [ $PHP_VERSION = '8.0' ]; then
COMPOSER_OPTIONS=' --ignore-platform-req=php'
fi
composer update --no-interaction --prefer-dist --optimize-autoloader $COMPOSER_OPTIONS || localExit=1
ok=$(( $localExit || $ok ))
echo ::endgroup::
if [ $localExit -ne 0 ]; then
echo "::error::$PACKAGE error"
fi
done
exit $ok
- name: Run tests
run: |
CURRENT_DIR=$(pwd)
ok=0
for PACKAGE in $(find src -maxdepth 4 -type f -name phpunit.xml.dist -printf '%h\n' | sort)
do
echo ::group::$PACKAGE
echo "$CURRENT_DIR/$PACKAGE"
cd "$CURRENT_DIR/$PACKAGE"
localExit=0
./vendor/bin/phpunit 2>&1 || localExit=1
ok=$(( $localExit || $ok ))
echo ::endgroup::
if [ $localExit -ne 0 ]; then
echo "::error::$PACKAGE failed"
fi
done
exit $ok