-
-
Notifications
You must be signed in to change notification settings - Fork 3
68 lines (66 loc) · 2.03 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
name: CI
on:
push:
branches:
tags:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
php: ['8.0', '8.1', '8.2']
include:
- operating-system: 'ubuntu-latest'
composer-flags: ' --prefer-stable'
php: '8.0'
- operating-system: 'ubuntu-latest'
php: '8.1'
composer-flags: ' --prefer-stable'
- operating-system: 'ubuntu-latest'
php: '8.2'
composer-flags: ' --prefer-stable'
services:
reindexer:
image: reindexer/reindexer
ports:
- 9088:9088
steps:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer
coverage: xdebug
- name: Show php and composer version
run: php -v && composer -V
- name: debug if needed
run: if [[ "$DEBUG" == "true" ]]; then env; fi
env:
DEBUG: ${{secrets.DEBUG}}
- name: Install dependencies
run: composer install --prefer-dist --no-dev
- name: Install phpunit and php-cs-fixer with specific version
run: |
composer update phpunit/phpunit ${{ matrix.composer-flags }} --dev
composer update friendsofphp/php-cs-fixer ${{ matrix.composer-flags }} --dev
- name: Run unit and integration tests
run: |
vendor/bin/phpunit --bootstrap vendor/autoload.php --coverage-clover=coverage.xml
env:
REINDEXER_HOST: "http://0.0.0.0:9088"
- name: "Upload coverage file"
uses: "actions/upload-artifact@v2"
with:
name: "phpunit-${{ matrix.deps }}-${{ matrix.php-version }}.coverage"
path: "coverage.xml"
- name: Run style-fixer
run: vendor/bin/php-cs-fixer fix --config .php-cs-fixer.php --dry-run
- name: "Download coverage files"
uses: "actions/[email protected]"
with:
path: "reports"
- uses: codecov/codecov-action@v2
with:
directory: "reports"
verbose: true # optional (default = false)