diff --git a/ci/php.yml b/ci/php.yml index 5053b43d44..af5c0e9c77 100644 --- a/ci/php.yml +++ b/ci/php.yml @@ -1,4 +1,9 @@ -name: PHP Composer +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: PHP on: push: @@ -10,18 +15,37 @@ jobs: build: runs-on: ubuntu-latest + + strategy: + matrix: + php-version: ['7.2', '7.3', '7.4'] steps: - uses: actions/checkout@v2 + # Setup PHP environment. + # Docs: https://github.com/shivammathur/setup-php/blob/master/README.md + - name: Set up PHP ${{ matrix.php-version }} + uses: shivammathur/setup-php@7961bc11b161170a2cf13fbe3573edb88fad7c29 + with: + php-version: ${{ matrix.php-version }} + # extensions: mbstring, intl # (optional) Specify the extensions you want to add or remove. + # ini-values: short_open_tag=On # (optional) Specify the values you want to add to php.ini. + # coverage: xdebug # (optional) Specify the code coverage driver you want to setup. + # tools: pecl # (optional) Specify the tools you want to setup + - name: Validate composer.json and composer.lock run: composer validate + - name: Get composer cache directory + id: composercache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - name: Cache Composer packages id: composer-cache uses: actions/cache@v2 with: - path: vendor + path: ${{ steps.composercache.outputs.dir }} key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} restore-keys: | ${{ runner.os }}-php-