|
| 1 | +name: GrumPHP |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | +jobs: |
| 5 | + run: |
| 6 | + runs-on: ${{ matrix.operating-system }} |
| 7 | + strategy: |
| 8 | + matrix: |
| 9 | + operating-system: [ubuntu-latest] |
| 10 | + php-versions: ['7.3', '7.4', '8.0'] |
| 11 | + composer-options: ['', '--prefer-lowest'] |
| 12 | + fail-fast: false |
| 13 | + name: PHP ${{ matrix.php-versions }} @ ${{ matrix.operating-system }} with ${{ matrix.composer-options }} |
| 14 | + steps: |
| 15 | + - name: Checkout |
| 16 | + uses: actions/checkout@master |
| 17 | + - name: Install PHP |
| 18 | + uses: shivammathur/setup-php@master |
| 19 | + with: |
| 20 | + php-version: ${{ matrix.php-versions }} |
| 21 | + tools: 'composer:v2' |
| 22 | + extensions: pcov, mbstring, posix |
| 23 | + - name: Check Versions |
| 24 | + run: | |
| 25 | + php -v |
| 26 | + php -m |
| 27 | + composer --version |
| 28 | + - name: Get composer cache directory |
| 29 | + id: composercache |
| 30 | + run: echo "::set-output name=dir::$(composer config cache-files-dir)" |
| 31 | + - name: Cache dependencies |
| 32 | + uses: actions/cache@v2 |
| 33 | + with: |
| 34 | + path: ${{ steps.composercache.outputs.dir }} |
| 35 | + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} |
| 36 | + restore-keys: ${{ runner.os }}-composer- |
| 37 | + - name: Install dependencies <PHP8 |
| 38 | + if: matrix.php-versions != '8.0' |
| 39 | + run: composer update --prefer-dist --no-progress --no-suggest ${{ matrix.composer-options }} |
| 40 | + # |
| 41 | + # Currently php-cs-fixer is nog PHP 8 compatible yet! |
| 42 | + # |
| 43 | + - name: Install dependencies PHP8 |
| 44 | + if: matrix.php-versions == '8.0' |
| 45 | + run: composer update --prefer-dist --no-progress --no-suggest ${{ matrix.composer-options }} --ignore-platform-reqs |
| 46 | + - name: Set git variables |
| 47 | + run: | |
| 48 | + git config --global user.email "you@example.com" |
| 49 | + git config --global user.name "Your Name" |
| 50 | + - name: Run the tests |
| 51 | + run: php vendor/bin/grumphp run --no-interaction |
| 52 | + env: |
| 53 | + PHP_CS_FIXER_IGNORE_ENV: ${{ matrix.php-versions == '8.0'}} |
0 commit comments