|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: ['master'] |
| 6 | + pull_request: |
| 7 | + branches: ['*'] |
| 8 | + schedule: |
| 9 | + - cron: '0 0 * * *' |
| 10 | + |
| 11 | +jobs: |
| 12 | + |
| 13 | + tests: |
| 14 | + name: Tests - PHP ${{ matrix.php }} ${{ matrix.dependency-version }} |
| 15 | + runs-on: ubuntu-latest |
| 16 | + timeout-minutes: 15 |
| 17 | + strategy: |
| 18 | + matrix: |
| 19 | + php: [ '7.2', '7.3', '7.4', '8.0' ] |
| 20 | + dependency-version: [ '' ] |
| 21 | + include: |
| 22 | + - php: '7.2' |
| 23 | + dependency-version: '--prefer-lowest' |
| 24 | + steps: |
| 25 | + - name: Checkout |
| 26 | + uses: actions/checkout@v2 |
| 27 | + - name: Setup PHP |
| 28 | + uses: shivammathur/setup-php@v2 |
| 29 | + with: |
| 30 | + php-version: ${{ matrix.php }} |
| 31 | + tools: composer:v2 |
| 32 | + coverage: none |
| 33 | + - name: Cache Composer dependencies |
| 34 | + uses: actions/cache@v2 |
| 35 | + with: |
| 36 | + path: ~/.composer/cache |
| 37 | + key: php-${{ matrix.php }}-composer-locked-${{ hashFiles('composer.lock') }} |
| 38 | + restore-keys: php-${{ matrix.php }}-composer-locked- |
| 39 | + - name: Install PHP dependencies |
| 40 | + run: composer update ${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-progress --no-suggest |
| 41 | + - name: PHPUnit |
| 42 | + run: vendor/bin/phpunit |
| 43 | + |
| 44 | + cs: |
| 45 | + name: Coding standards |
| 46 | + runs-on: ubuntu-latest |
| 47 | + steps: |
| 48 | + - name: Checkout |
| 49 | + uses: actions/checkout@v2 |
| 50 | + - name: Setup PHP |
| 51 | + uses: shivammathur/setup-php@v2 |
| 52 | + with: |
| 53 | + php-version: 7.4 |
| 54 | + tools: composer:v2, cs2pr |
| 55 | + coverage: none |
| 56 | + - name: Cache Composer dependencies |
| 57 | + uses: actions/cache@v2 |
| 58 | + with: |
| 59 | + path: ~/.composer/cache |
| 60 | + key: php-74-composer-locked-${{ hashFiles('composer.lock') }} |
| 61 | + restore-keys: php-74-composer-locked- |
| 62 | + - name: Install PHP dependencies |
| 63 | + run: composer install --no-interaction --no-progress --no-suggest |
| 64 | + - name: PHP CodeSniffer |
| 65 | + run: vendor/bin/phpcs -q --no-colors --report=checkstyle | cs2pr |
0 commit comments