-
-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (64 loc) · 2.04 KB
/
diagnostics.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
name: Code Quality Diagnostics
on:
pull_request:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
name: PHP ${{ matrix.php }}
strategy:
fail-fast: false
matrix:
include:
- php: 7.4
output: '-o github-action -o default'
phpcq_install: 'install'
- php: 8.0
output: '-o default'
phpcq_install: 'update'
steps:
- name: Pull source
uses: actions/checkout@v2
- name: Setup PHP with PECL extension
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
- name: Cache composer cache directory
uses: actions/cache@v1
env:
cache-name: composer-cache-dir-${{ matrix.php }}
with:
path: ~/.cache/composer
key: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Install composer dependencies
run: composer install
- name: Cache vendor directory
uses: actions/cache@v1
env:
cache-name: vendor-${{ matrix.php }}
with:
path: vendor
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
- name: Install phpcq toolchain
run: ./vendor/bin/phpcq ${{ matrix.phpcq_install }} -v
- name: Cache phpcq directory
uses: actions/cache@v1
env:
cache-name: phpcq-${{ matrix.php }}
with:
path: .phpcq
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/.phpcq.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
- name: Run tests
run: ./vendor/bin/phpcq run -v ${{ matrix.output }}
- name: Upload build directory to artifact
uses: actions/upload-artifact@v2
if: ${{ success() }} || ${{ failure() }}
with:
name: phpcq-builds-php-${{ matrix.php }}
path: .phpcq/build/