|
7 | 7 | jobs:
|
8 | 8 | build:
|
9 | 9 | runs-on: ubuntu-latest
|
| 10 | + name: 'PHP: ${{ matrix.php }} Symfony: ${{ matrix.symfony}} Experimental: ${{ matrix.experimental}}' |
| 11 | + continue-on-error: ${{ matrix.experimental }} |
10 | 12 | strategy:
|
| 13 | + fail-fast: true |
11 | 14 | 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 |
13 | 56 |
|
14 | 57 | steps:
|
15 |
| - - name: PHP ${{ matrix.php }} Pull source |
| 58 | + - name: Pull source |
16 | 59 | uses: actions/checkout@v2
|
17 |
| - with: |
18 |
| - fetch-depth: 0 |
19 | 60 |
|
20 | 61 | # see https://github.com/shivammathur/setup-php
|
21 |
| - - name: PHP ${{ matrix.php }} Setup PHP. |
| 62 | + - name: Setup PHP with PECL extension |
22 | 63 | uses: shivammathur/setup-php@v2
|
23 | 64 | with:
|
24 | 65 | php-version: ${{ matrix.php }}
|
25 |
| - coverage: none |
26 | 66 |
|
27 |
| - - name: PHP ${{ matrix.php }} Cache composer cache directory |
| 67 | + # setup caches |
| 68 | + - name: Cache composer cache directory |
28 | 69 | uses: actions/cache@v1
|
29 | 70 | env:
|
30 | 71 | cache-name: composer-cache-dir
|
31 | 72 | with:
|
32 | 73 | path: ~/.cache/composer
|
33 |
| - key: ${{ runner.os }}-build-${{ env.cache-name }} |
| 74 | + key: ${{ runner.os }}-${{ matrix.php }}-build-${{ env.cache-name }} |
34 | 75 |
|
35 |
| - - name: PHP ${{ matrix.php }} Cache vendor directory |
| 76 | + - name: Cache vendor directory |
36 | 77 | uses: actions/cache@v1
|
37 | 78 | env:
|
38 |
| - cache-name: composer-vendor |
| 79 | + cache-name: vendor |
39 | 80 | with:
|
40 | 81 | 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') }} |
42 | 83 | 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 }}- |
46 | 85 |
|
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