-
Notifications
You must be signed in to change notification settings - Fork 57
83 lines (74 loc) · 2.42 KB
/
php.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
name: PHPQA CI
on:
pull_request:
push:
branches:
- master
jobs:
phpqa:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
php: [5.5]
include:
# PHP5
- { php: 5.4, areSuggestedToolsInstalled: yes }
- { php: 5.6, areSuggestedToolsInstalled: yes, allowedSecurityErrors: 1 }
# PHP7
- { php: 7.0 }
- { php: 7.1, areSuggestedToolsInstalled: yes }
- { php: 7.2, areSuggestedToolsInstalled: yes }
- { php: 7.3 }
- { php: 7.4, areSuggestedToolsInstalled: yes }
# PHP8
- { php: 8.0, areSuggestedToolsInstalled: yes }
- { php: 8.1, areSuggestedToolsInstalled: yes }
- { php: 8.2, areSuggestedToolsInstalled: yes }
stability: [prefer-stable]
steps:
- uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: xsl, zip, json
coverage: none
# default composer.lock with symfony2 components + psalm = composer error
# https://github.com/EdgedesignCZ/phpqa/runs/1844081585?check_suite_focus=true#step:5:112
tools: ${{ (matrix.php != '7.2' && 'composer:v2') || 'composer:v1' }}
- name: Cache composer
uses: actions/cache@v2
with:
path: |
~/.composer/cache
vendor
key: php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: "php-${{ matrix.php }}-composer-"
- name: Install dependencies
env:
PHP_VERSION: ${{ matrix.php }}
INSTALL_SUGGESTED_TOOLS: ${{ matrix.areSuggestedToolsInstalled || 'no' }}
run: |
if [[ $INSTALL_SUGGESTED_TOOLS == "yes" ]]; then
PHP_VERSION=$PHP_VERSION bin/suggested-tools.sh install;
else
composer install --no-interaction --no-progress;
fi
php tests/.phpunit/fix-typehints.php;
- name: Show versions
run: |
composer outdated --direct --all
./phpqa tools --config tests/.ci
- name: Run tests
env:
ALLOWED_SECURITY_ERRORS: ${{ matrix.allowedSecurityErrors || '' }}
run: |
vendor/phpunit/phpunit/phpunit
bin/ci.sh
ls -lAh build
- name: Upload QA files
uses: actions/upload-artifact@v2
with:
name: phpqa-${{ matrix.php }}
path: build