forked from gnikyt/laravel-shopify
-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (81 loc) · 2.73 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
90
91
92
93
94
95
96
97
name: Package Test
on: [ push, pull_request ]
jobs:
ci:
runs-on: ubuntu-latest
strategy:
max-parallel: 3
matrix:
php:
- '7.2'
- '7.3'
- '7.4'
- '8.0'
analysis: [ false ]
coverage: [ 'none' ]
normalize: [ false ]
validate: [ false ]
laravel:
- '7.0'
- '8.22'
- '9.0'
exclude:
- php: '7.2'
laravel: '8.22'
- php: '8.0'
laravel: '7.0'
- php: '8.0'
laravel: '8.22'
- php: '7.2'
laravel: '9.0'
- php: '7.3'
laravel: '9.0'
- php: '7.4'
laravel: '9.0'
include:
- php: '8.0'
laravel: '8.22'
analysis: true
coverage: 'xdebug'
normalize: true
validate: true
name: PHP ${{ matrix.php }} / Laravel ${{ matrix.laravel }}
steps:
- name: Checkout the code
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: ${{ matrix.coverage }}
extensions: dom, fileinfo, json, mbstring, pdo_sqlite
- name: Validate composer setup
if: matrix.validate == true
run: composer validate --strict
- name: Install Laravel legacy factories support
if: matrix.laravel == '8.22'
run: composer require "laravel/legacy-factories:^1.1" --dev --no-interaction --no-update
- name: Install Laravel and Orchestra Testbench
run: composer require "illuminate/contracts:${{ matrix.laravel }}" --no-interaction --no-update
- 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 }}-laravel-${{ matrix.laravel }}-${{ hashFiles('**/composer.json') }}"
restore-keys: "php-${{ matrix.php }}-laravel-${{ matrix.laravel }}-${{ hashFiles('**/composer.json') }}"
- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: Normalize composer file
if: matrix.normalize == true && matrix.php != '8.0'
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'