forked from wikimedia/less.php
-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (83 loc) · 2.89 KB
/
php.yml
File metadata and controls
107 lines (83 loc) · 2.89 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
104
105
106
107
name: Test
on:
- push
- pull_request
jobs:
php:
name: PHP ${{ matrix.php }}
strategy:
fail-fast: false
matrix:
include:
# Includes php7.1 - 8.0 and composer 2
# https://github.com/actions/virtual-environments/blob/ubuntu18/20210318.0/images/linux/Ubuntu1804-README.md#php
- php: '7.2'
os: ubuntu-18.04
- php: '7.3'
os: ubuntu-18.04
# Includes php7.4 - 8.0 and composer 2
# https://github.com/actions/virtual-environments/blob/ubuntu20/20210318.0/images/linux/Ubuntu2004-README.md#php
- php: '7.4'
os: ubuntu-20.04
- php: '8.0'
os: ubuntu-20.04
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use PHP ${{ matrix.php }}
run: sudo update-alternatives --set php /usr/bin/php${{ matrix.php }}
- name: Validate composer.json and composer.lock
run: composer validate
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest
- name: Test
run: composer test
php-cover:
name: PHP ${{ matrix.php }} coverage
strategy:
matrix:
include:
# PHPUnit 8.5 does not support code coverage on PHP 8
- php: '7.4'
os: ubuntu-20.04
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use PHP ${{ matrix.php }}
run: sudo update-alternatives --set php /usr/bin/php${{ matrix.php }}
- name: Validate
run: composer validate
- name: Install
run: composer install --prefer-dist --no-progress --no-suggest
- name: Test with coverage
run: composer cover
env:
XDEBUG_MODE: coverage
php-phan:
name: Phan
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use PHP 7.4
run: sudo update-alternatives --set php /usr/bin/php7.4
- name: Validate
run: composer validate
- name: Install
run: composer install --prefer-dist --no-progress --no-suggest
- name: phan
run: composer phan
# FIXME:
# - Without 'continue-on-error', it means the commit-level status indicator
# in commit logs, file history, and PR overview will be marked as
# failure (even if PR requirements allow Phan to fail), which is confusing
# and can also cause email spam.
# - With 'continue-on-error' it means the build is falsely marked as passing.
# and you have to click two times, scroll down, click once more to find out
# whether it is still failing or not. This is the least-worst of option for
# now, but go complain at <https://github.com/actions/toolkit/issues/399>
# for GitHub to implememnt a reasonable "allow failure" job-level option.
#
continue-on-error: true