|
1 | 1 | ---
|
2 |
| -name: Build |
| 2 | +name: build |
3 | 3 | on:
|
4 | 4 | push: ~
|
5 | 5 | pull_request: ~
|
6 | 6 |
|
7 | 7 | jobs:
|
8 |
| - phpunit: |
9 |
| - name: PHPUnit tests on ${{ matrix.php }} ${{ matrix.composer-flags }} |
10 |
| - runs-on: ubuntu-latest |
| 8 | + linux_tests: |
| 9 | + name: PHP on ${{ matrix.php }} - ${{ matrix.stability }} - ${{ matrix.composer-flags }} |
| 10 | + runs-on: ubuntu-20.04 |
11 | 11 | strategy:
|
12 | 12 | matrix:
|
13 | 13 | php: ['8.1']
|
14 |
| - composer-flags: [ '' ] |
15 |
| - phpunit-flags: [ '--coverage-text' ] |
| 14 | + stability: [prefer-lowest, prefer-stable] |
| 15 | + include: |
| 16 | + - php: '8.2' |
| 17 | + flags: "--ignore-platform-req=php" |
| 18 | + phpunit-flags: '--no-coverage' |
| 19 | + stability: prefer-stable |
16 | 20 | steps:
|
17 |
| - - uses: actions/checkout@v2 |
18 |
| - - uses: shivammathur/setup-php@v2 |
| 21 | + - name: Checkout code |
| 22 | + uses: actions/checkout@v2 |
| 23 | + |
| 24 | + - name: Setup PHP |
| 25 | + uses: shivammathur/setup-php@v2 |
19 | 26 | with:
|
20 | 27 | php-version: ${{ matrix.php }}
|
21 |
| - coverage: pcov |
| 28 | + coverage: xdebug |
22 | 29 | tools: composer:v2
|
23 |
| - - run: composer update --no-progress ${{ matrix.composer-flags }} |
24 |
| - - run: composer phpunit |
25 |
| - - run: composer phpstan |
26 |
| - - run: composer phpcs |
| 30 | + - name: Check PHP Version |
| 31 | + run: php -v |
| 32 | + |
| 33 | + - name: Validate composer files |
| 34 | + run: composer validate --strict |
| 35 | + |
| 36 | + - name: Get Composer Cache Directory |
| 37 | + id: composer-cache |
| 38 | + run: | |
| 39 | + echo "::set-output name=dir::$(composer config cache-files-dir)" |
| 40 | + - uses: actions/cache@v2 |
| 41 | + with: |
| 42 | + path: ${{ steps.composer-cache.outputs.dir }} |
| 43 | + key: ${{ runner.os }}-composer-${{ matrix.stability }}-${{ matrix.flags }}-${{ hashFiles('**/composer.lock') }} |
| 44 | + restore-keys: | |
| 45 | + ${{ runner.os }}-composer-${{ matrix.stability }}-${{ matrix.flags }}- |
| 46 | + ${{ runner.os }}-composer- |
| 47 | +
|
| 48 | + - name: Install dependencies |
| 49 | + run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress ${{ matrix.flags }} |
| 50 | + |
| 51 | + - name: Run Unit tests with coverage |
| 52 | + run: composer phpunit -- ${{ matrix.phpunit-flags }} |
| 53 | + |
| 54 | + - name: Run static analysis |
| 55 | + run: composer phpstan |
| 56 | + if: ${{ matrix.php == '8.1' && matrix.stability == 'prefer-stable'}} |
| 57 | + |
| 58 | + - name: Run Coding style rules |
| 59 | + run: composer phpcs:fix |
| 60 | + if: ${{ matrix.php == '8.1' && matrix.stability == 'prefer-stable'}} |
0 commit comments