| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- name: build
- on:
- - push
- - pull_request
- jobs:
- tests:
- name: PHP ${{ matrix.php }} Test on ${{ matrix.os }}
- env:
- extensions: bz2, dom, iconv, fileinfo, openssl, xml, zlib
- key: cache-v1
- strategy:
- matrix:
- os:
- - ubuntu-latest
- - windows-latest
- php:
- - '7.4'
- - '8.0'
- runs-on: ${{ matrix.os }}
- steps:
- -
- name: Checkout
- uses: actions/checkout@v1
- -
- name: Install linux dependencies
- run: sudo apt-get install unzip p7zip-full
- -
- name: Install PHP with extensions
- uses: shivammathur/setup-php@v2
- with:
- php-version: ${{ matrix.php }}
- extensions: ${{ env.extensions }}
- coverage: pcov
- ini-values: date.timezone='UTC'
- tools: composer:v2
- -
- name: Determine composer cache directory on Linux
- if: matrix.os == 'ubuntu-latest'
- run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
- -
- name: Determine composer cache directory on Windows
- if: matrix.os == 'windows-latest'
- run: echo "COMPOSER_CACHE_DIR=~\AppData\Local\Composer" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- -
- 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: Check PHP Version
- run: php -v
- -
- name: Check Composer Version
- run: composer -V
- -
- name: Check PHP Extensions
- run: php -m
- -
- name: Validate composer.json and composer.lock
- run: composer validate
- -
- name: Install dependencies with composer
- run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
- -
- name: Run tests with phpunit
- run: vendor/bin/phpunit --colors=always
|