-
Notifications
You must be signed in to change notification settings - Fork 32
89 lines (73 loc) · 2.99 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: CI
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: [8.1, 8.2]
dependencies: ["", "--prefer-lowest --prefer-stable"]
execute-cs-check: [true, false]
test-coverage: [true, false]
env:
COMPOSER_CACHE_DIR: ${{ github.workspace }}/.composer/cache
PHP_CS_FIXER_CACHE_DIR: ${{ github.workspace }}/.php-cs-fixer
LOCAL_CACHE_DIR: ${{ github.workspace }}/.local
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: ${{ matrix.test-coverage }}
extensions: pcov
ini-values: |
memory_limit=-1
tools: composer:v2
- name: Cache dependencies
uses: actions/cache@v2
with:
path: |
${{ env.COMPOSER_CACHE_DIR }}
${{ env.PHP_CS_FIXER_CACHE_DIR }}
${{ env.LOCAL_CACHE_DIR }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install EventStore
run: |
echo downloading EventStore 5.0.10
wget https://github.com/EventStore/Downloads/raw/master/ubuntu/EventStore-OSS-Linux-Ubuntu-16.04-v5.0.10.tar.gz
echo extracting event-store
tar xf EventStore-OSS-Linux-Ubuntu-16.04-v5.0.10.tar.gz
cd EventStore-OSS-Linux-Ubuntu-16.04-v5.0.10
echo starting event-store
./run-node.sh --run-projections=all --mem-db --ext-tcp-heartbeat-interval 5000 --ext-tcp-heartbeat-timeout 1500 > /dev/null &
cd ..
mkdir -p ${{ env.PHP_CS_FIXER_CACHE_DIR }}
- name: Disable Xdebug if enabled
run: if php --ri xdebug >/dev/null; then phpenv config-rm xdebug.ini; fi
- name: Self-update Composer
run: composer self-update
- name: Install dependencies
run: composer update --prefer-dist ${{ matrix.dependencies }}
- name: Run tests
run: |
if [ "${{ matrix.test-coverage }}" == "true" ]; then
php ./vendor/bin/phpunit --exclude-group=ignore --coverage-text --coverage-clover ./build/logs/clover.xml
else
./vendor/bin/phpunit --exclude-group=ignore
fi
- name: Run CS check
if: ${{ matrix.execute-cs-check }} == 'true'
run: ./vendor/bin/php-cs-fixer fix -v --diff --dry-run
- name: Stop EventStore
run: wget --http-user="admin" --http-password="changeit" --post-data='' http://localhost:2113/admin/shutdown
- name: Upload coverage to Coveralls
if: ${{ matrix.test-coverage }} == 'true'
run: php vendor/bin/php-coveralls -v
- name: Send notifications
uses: brianchandotcom/liferay-npm-scripts-send-to-gitter-action@v1
with:
url: https://webhooks.gitter.im/e/61c75218816eebde4486
status: ${{ job.status }}