Skip to content

Commit a19e7ba

Browse files
committed
Update github action
1 parent a5fc5a7 commit a19e7ba

File tree

1 file changed

+82
-16
lines changed

1 file changed

+82
-16
lines changed

.github/workflows/diagnostics.yml

+82-16
Original file line numberDiff line numberDiff line change
@@ -7,42 +7,108 @@ on:
77
jobs:
88
build:
99
runs-on: ubuntu-latest
10+
name: 'PHP: ${{ matrix.php }} Symfony: ${{ matrix.symfony}} Experimental: ${{ matrix.experimental}}'
11+
continue-on-error: ${{ matrix.experimental }}
1012
strategy:
13+
fail-fast: true
1114
matrix:
12-
php: [5.6, 7.1, 7.2, 7.3, 7.4]
15+
include:
16+
- php: '7.4'
17+
symfony: '^4.0'
18+
phpcq_install: 'install'
19+
output: '-o github-action -o default'
20+
experimental: false
21+
- php: '7.4'
22+
symfony: '^5.0'
23+
phpcq_install: 'update'
24+
output: '-o github-action -o default'
25+
experimental: false
26+
- php: '8.0'
27+
symfony: '^4.0'
28+
phpcq_install: 'update'
29+
output: '-o github-action -o default'
30+
experimental: false
31+
- php: '8.0'
32+
symfony: '^5.0'
33+
phpcq_install: 'update'
34+
output: '-o github-action -o default'
35+
experimental: false
36+
- php: '8.1'
37+
symfony: '^5.0'
38+
phpcq_install: 'update'
39+
output: '-o github-action -o default'
40+
experimental: false
41+
- php: '8.1'
42+
symfony: '^6.0'
43+
phpcq_install: 'update'
44+
output: '-o github-action -o default'
45+
experimental: false
46+
- php: '8.2'
47+
symfony: '^6.0'
48+
phpcq_install: 'update'
49+
output: '-o github-action -o default'
50+
experimental: false
51+
- php: '8.3'
52+
symfony: '^6.0'
53+
phpcq_install: 'update'
54+
output: '-o github-action -o default'
55+
experimental: true
1356

1457
steps:
15-
- name: PHP ${{ matrix.php }} Pull source
58+
- name: Pull source
1659
uses: actions/checkout@v2
17-
with:
18-
fetch-depth: 0
1960

2061
# see https://github.com/shivammathur/setup-php
21-
- name: PHP ${{ matrix.php }} Setup PHP.
62+
- name: Setup PHP with PECL extension
2263
uses: shivammathur/setup-php@v2
2364
with:
2465
php-version: ${{ matrix.php }}
25-
coverage: none
2666

27-
- name: PHP ${{ matrix.php }} Cache composer cache directory
67+
# setup caches
68+
- name: Cache composer cache directory
2869
uses: actions/cache@v1
2970
env:
3071
cache-name: composer-cache-dir
3172
with:
3273
path: ~/.cache/composer
33-
key: ${{ runner.os }}-build-${{ env.cache-name }}
74+
key: ${{ runner.os }}-${{ matrix.php }}-build-${{ env.cache-name }}
3475

35-
- name: PHP ${{ matrix.php }} Cache vendor directory
76+
- name: Cache vendor directory
3677
uses: actions/cache@v1
3778
env:
38-
cache-name: composer-vendor
79+
cache-name: vendor
3980
with:
4081
path: vendor
41-
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/composer.lock') }}
82+
key: ${{ runner.os }}-${{ matrix.php }}-${{ matrix.symfony }}-build-${{ env.cache-name }}-${{ hashFiles('**/composer.lock') }}
4283
restore-keys: |
43-
${{ runner.os }}-build-${{ env.cache-name }}-
44-
- name: PHP ${{ matrix.php }} Install composer dependencies
45-
run: composer update --prefer-dist --no-interaction --no-suggest
84+
${{ runner.os }}-${{ matrix.php }}-${{ matrix.symfony }}-build-${{ env.cache-name }}-
4685
47-
- name: PHP ${{ matrix.php }} Run tests
48-
run: ant -keep-going
86+
- name: Cache phpcq directory
87+
uses: actions/cache@v1
88+
env:
89+
cache-name: phpcq
90+
with:
91+
path: .phpcq
92+
key: ${{ runner.os }}-${{ matrix.php }}-build-${{ env.cache-name }}-${{ hashFiles('**/.phpcq.lock') }}
93+
restore-keys: |
94+
${{ runner.os }}-${{ matrix.php }}-build-${{ env.cache-name }}-
95+
96+
# install dependencies and tools
97+
- name: Install composer dependencies
98+
run: |
99+
composer require symfony/process ${{ matrix.symfony }} --no-update
100+
composer require symfony/filesystem ${{ matrix.symfony }} --no-update
101+
composer install
102+
- name: Install phpcq toolchain
103+
run: ./vendor/bin/phpcq ${{ matrix.phpcq_install }} -v
104+
105+
# run tests
106+
- name: Run tests
107+
run: ./vendor/bin/phpcq run -v ${{ matrix.output }}
108+
109+
- name: Upload build directory to artifact
110+
uses: actions/upload-artifact@v2
111+
if: ${{ success() }} || ${{ failure() }}
112+
with:
113+
name: phpcq-builds-php-${{ matrix.php }}-${{ matrix.symfony }}
114+
path: .phpcq/build/

0 commit comments

Comments
 (0)