-
Notifications
You must be signed in to change notification settings - Fork 32
84 lines (70 loc) · 2.97 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
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"]
env:
COMPOSER_CACHE_DIR: ${{ github.workspace }}/.composer/cache
PHP_CS_FIXER_CACHE_DIR: ${{ github.workspace }}/.php-cs-fixer
LOCAL_CACHE_DIR: ${{ github.workspace }}/.local
GITHUB_REF: ${{ github.ref }}
GITHUB_ACTIONS: true
GITHUB_RUN_ID: ${{ github.run_id }}
GITHUB_EVENT_NAME: ${{ github.event_name }}
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: ${{ matrix.php-version == '8.2' && matrix.dependencies == '' }}
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 --ext-http-prefixes="http://*:2113/" --add-interface-prefixes=false > /dev/null &
cd ..
mkdir -p ${{ env.PHP_CS_FIXER_CACHE_DIR }}
- name: Disable Xdebug
if: ${{ matrix.php-version != '8.2' && matrix.dependencies != '' }}
run: sudo phpdismod xdebug
- name: Self-update Composer
run: composer self-update
- name: Install dependencies
run: composer update --prefer-dist ${{ matrix.dependencies }}
- name: Run tests
run: |
if [ "${{ matrix.php-version }}" == "8.2" ] && [ "${{ matrix.dependencies }}" == "" ]; 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.php-version == '8.2' && matrix.dependencies == '' }}
run: ./vendor/bin/php-cs-fixer fix -v --diff --dry-run
- name: Upload coverage to Coveralls
if: ${{ matrix.php-version == '8.2' && matrix.dependencies == '' }}
run: php vendor/bin/php-coveralls -v