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