| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- on:
- - pull_request
- - push
- name: build
- jobs:
- tests:
- name: PHP-${{ matrix.php }}-${{ matrix.os }}
- env:
- key: cache-v1
- runs-on: ${{ matrix.os }}
- strategy:
- matrix:
- os:
- - ubuntu-latest
- php:
- - "5.4"
- - "5.5"
- - "5.6"
- - "7.0"
- - "7.1"
- - "7.2"
- - "7.3"
- - "7.4"
- - "8.0"
- composer:
- - "dev-master"
- steps:
- - name: Configure git
- run: git config --global core.autocrlf false
- - name: Checkout
- uses: actions/checkout@v2.3.4
- - name: Determine composer cache directory
- run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
- - name: Cache dependencies installed with composer
- uses: actions/cache@v2
- with:
- path: ${{ env.COMPOSER_CACHE_DIR }}
- key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
- restore-keys: |
- php${{ matrix.php }}-composer-
- - name: Install composer
- run: composer require --dev "composer/composer:${{ matrix.composer }}" --update-with-dependencies
- - name: Run tests with phpunit
- if: matrix.php != '7.4'
- run: |
- vendor/bin/phpunit --verbose --colors=always
- cd tests/scripts && sh run.sh
- - name: Run tests with phpunit
- if: matrix.php == '7.4'
- run: |
- vendor/bin/phpunit --verbose --coverage-clover=clover.xml --colors=always
- cd tests/scripts && sh run.sh
- - name: Upload code coverage scrutinizer
- if: matrix.php == '7.4'
- run: |
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover
|