-
Notifications
You must be signed in to change notification settings - Fork 69
80 lines (66 loc) · 2.03 KB
/
Copy pathci.yml
File metadata and controls
80 lines (66 loc) · 2.03 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
name: Package Test
on: [ push, pull_request ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 3
matrix:
php:
- '7.3'
- '7.4'
- '8.0'
- '8.1'
analysis: [ false ]
coverage: [ 'none' ]
fast-fail: [ false ]
normalize: [ false ]
validate: [ false ]
exclude:
- php: '8.0'
- php: '8.1'
include:
- php: '8.0'
analysis: true
coverage: 'xdebug'
normalize: true
validate: true
- php: '8.1'
fast-fail: true
name: PHP ${{ matrix.php }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php: ${{ matrix.php }}
coverage: ${{ matrix.coverage }}
extensions: json, mbstring
env:
fail-fast: ${{ matrix.fast-fail }}
- name: Validate composer setup
if: matrix.validate == true
run: composer validate --strict
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: "php-${{ matrix.php }}-${{ hashFiles('**/composer.json') }}"
restore-keys: "php-${{ matrix.php }}-${{ hashFiles('**/composer.json') }}"
- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: Normalize composer file
if: matrix.normalize == true
run: composer normalize --dry-run
- name: Run test suite
run: vendor/bin/phpunit -v
- name: Run static code analysis
if: matrix.analysis == true
run: vendor/bin/phpstan --memory-limit=-1
- name: Upload coverage results
uses: codecov/codecov-action@v1
if: matrix.coverage != 'none'