|
1 | 1 | name: MetaModels attribute_file
|
2 | 2 |
|
3 | 3 | on:
|
4 |
| - push: |
5 |
| - branches-ignore: |
6 |
| - - '**-translation' |
7 | 4 | pull_request:
|
| 5 | + push: |
| 6 | + branches: |
8 | 7 |
|
9 | 8 | jobs:
|
10 | 9 | build:
|
11 | 10 | runs-on: ubuntu-latest
|
| 11 | + name: 'PHP: ${{ matrix.php }} Contao: ${{ matrix.contao }}' |
12 | 12 | strategy:
|
| 13 | + fail-fast: false |
13 | 14 | matrix:
|
14 |
| - php: [7.4] |
15 |
| - contao: [~4.9.0] |
| 15 | + php: [ '8.1', '8.2', '8.3' ] |
| 16 | + contao: [ '~4.13.0' ] |
| 17 | + phpcq_install: [ 'update' ] |
| 18 | + output: [ '-o github-action -o default' ] |
16 | 19 |
|
17 | 20 | steps:
|
18 |
| - - name: PHP ${{ matrix.php }} ${{ matrix.contao }} Pull source |
19 |
| - uses: actions/checkout@v3 |
20 |
| - with: |
21 |
| - fetch-depth: 0 |
| 21 | + - name: Pull source |
| 22 | + uses: actions/checkout@v4 |
22 | 23 |
|
23 |
| - # see https://github.com/shivammathur/setup-php |
24 |
| - - name: PHP ${{ matrix.php }} ${{ matrix.contao }} Setup PHP. |
| 24 | + - name: Setup PHP with PECL extension |
25 | 25 | uses: shivammathur/setup-php@v2
|
26 | 26 | with:
|
27 | 27 | php-version: ${{ matrix.php }}
|
28 |
| - coverage: none |
29 | 28 |
|
30 |
| - - name: PHP ${{ matrix.php }} ${{ matrix.contao }} Cache composer cache directory |
31 |
| - uses: actions/cache@v3 |
| 29 | + # setup caches |
| 30 | + - name: Cache composer cache directory |
| 31 | + uses: actions/cache@v4 |
32 | 32 | env:
|
33 | 33 | cache-name: composer-cache-dir
|
34 | 34 | with:
|
35 | 35 | path: ~/.cache/composer
|
36 |
| - key: ${{ runner.os }}-build-${{ env.cache-name }} |
| 36 | + key: ${{ runner.os }}-${{ matrix.php }}-build-${{ env.cache-name }} |
37 | 37 |
|
38 |
| - - name: PHP ${{ matrix.php }} ${{ matrix.contao }} Cache vendor directory |
39 |
| - uses: actions/cache@v3 |
| 38 | + - name: Cache vendor directory |
| 39 | + uses: actions/cache@v4 |
40 | 40 | env:
|
41 |
| - cache-name: composer-vendor |
| 41 | + cache-name: vendor |
42 | 42 | with:
|
43 | 43 | path: vendor
|
44 |
| - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/composer.lock') }} |
| 44 | + key: ${{ runner.os }}-${{ matrix.php }}-${{ matrix.contao }}-build-${{ env.cache-name }}-${{ hashFiles('**/composer.lock') }} |
45 | 45 | restore-keys: |
|
46 |
| - ${{ runner.os }}-build-${{ env.cache-name }}- |
| 46 | + ${{ runner.os }}-${{ matrix.php }}-${{ matrix.contao }}-build-${{ env.cache-name }}- |
47 | 47 |
|
48 |
| - - name: PHP ${{ matrix.php }} ${{ matrix.contao }} Install composer dependencies |
49 |
| - run: composer update --prefer-dist --no-interaction --no-suggest |
| 48 | + - name: Cache phpcq directory |
| 49 | + uses: actions/cache@v4 |
| 50 | + env: |
| 51 | + cache-name: phpcq |
| 52 | + with: |
| 53 | + path: .phpcq |
| 54 | + key: ${{ runner.os }}-${{ matrix.php }}-build-${{ env.cache-name }}-${{ hashFiles('**/.phpcq.lock') }} |
| 55 | + restore-keys: | |
| 56 | + ${{ runner.os }}-${{ matrix.php }}-build-${{ env.cache-name }}- |
| 57 | +
|
| 58 | + # install dependencies and tools |
| 59 | + - name: Install composer dependencies |
| 60 | + run: | |
| 61 | + composer require contao/core-bundle ${{ matrix.contao }} --no-update |
| 62 | + composer install |
| 63 | + - name: Install phpcq toolchain |
| 64 | + run: ./vendor/bin/phpcq ${{ matrix.phpcq_install }} -v |
50 | 65 |
|
51 |
| - - name: PHP ${{ matrix.php }} ${{ matrix.contao }} Run tests |
52 |
| - run: ant -keep-going |
| 66 | + # run tests |
| 67 | + - name: Run tests |
| 68 | + run: ./vendor/bin/phpcq run -v ${{ matrix.output }} |
| 69 | + |
| 70 | + - name: Upload build directory to artifact |
| 71 | + uses: actions/upload-artifact@v4 |
| 72 | + if: ${{ success() }} || ${{ failure() }} |
| 73 | + with: |
| 74 | + name: phpcq-builds-php-${{ matrix.php }}-${{ matrix.contao }} |
| 75 | + path: .phpcq/build/ |
0 commit comments