forked from cebe/php-openapi
-
Notifications
You must be signed in to change notification settings - Fork 0
103 lines (83 loc) · 3 KB
/
Copy pathphp.yml
File metadata and controls
103 lines (83 loc) · 3 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: PHP Composer
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
strategy:
fail-fast: false
matrix:
# os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest]
php: ['7.1', '7.2', '7.3', '7.4', '8.0']
# max 4.4.16, see https://github.com/symfony/symfony/issues/39521
# max 5.1.8, see https://github.com/symfony/symfony/issues/39521
yaml: ['5.2.9', '5.1.11', '4.4.24', '^3.4']
exclude:
# Symfony YAML does not run on PHP 7.1
- php: '7.1'
yaml: '5.1.11'
- php: '7.1'
yaml: '5.2.9'
include:
- php: '7.4'
os: windows-latest
yaml: '5.2.9'
- php: '7.4'
os: macos-latest
yaml: '5.2.9'
runs-on: ${{ matrix.os }}
env:
YAML: ${{ matrix.yaml }}
steps:
- uses: actions/checkout@v2
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
ini-values: date.timezone='UTC'
coverage: pcov
tools: composer:v2
- name: Determine composer cache directory (Linux/MacOS)
if: matrix.os != 'windows-latest'
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
- name: Determine composer cache directory (Windows)
if: matrix.os == 'windows-latest'
run: echo "COMPOSER_CACHE_DIR=~\AppData\Local\Composer" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Cache dependencies installed with composer
uses: actions/cache@v2
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: php${{ matrix.php }}-os${{ matrix.os }}-yaml${{ matrix.yaml }}-composer-${{ hashFiles('**/composer.json') }}
- name: Validate composer.json and composer.lock
run: composer validate --ansi
- name: Install dependencies (Linux/MacOS)
if: matrix.os != 'windows-latest'
run: |
make install
composer require symfony/yaml:"${YAML}" --prefer-dist --no-interaction --ansi
- name: Install dependencies (Windows)
if: matrix.os == 'windows-latest'
run: |
composer install --prefer-dist --no-interaction --no-progress --ansi
composer require symfony/yaml:5.1.8 --prefer-dist --no-interaction --ansi
- name: Validate test data
if: matrix.os == 'ubuntu-latest'
run: make lint
- name: PHP Stan analysis
if: matrix.os == 'ubuntu-latest'
run: make stan
- name: PHPUnit tests (Linux/MacOS)
if: matrix.os != 'windows-latest'
run: make test
- name: PHPUnit tests (Windows)
if: matrix.os == 'windows-latest'
run: vendor/bin/phpunit --colors=always
- name: Check code style
if: matrix.os == 'ubuntu-latest'
run: make check-style
- name: Code coverage
if: matrix.os == 'ubuntu-latest'
run: make coverage