Skip to content

Commit

Permalink
Enhancement: Use shivammathur/setup-php to set up PHP
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz authored and sebastianbergmann committed Nov 27, 2019
1 parent 412fa18 commit cfa81d1
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ jobs:

strategy:
matrix:
php-binary:
- php7.2
- php7.3
php-version:
- 7.2
- 7.3

dependencies:
- lowest
Expand All @@ -85,27 +85,35 @@ jobs:
- name: Checkout
uses: actions/checkout@master

- name: "Install PHP with extensions"
uses: shivammathur/setup-php@master
with:
php-version: ${{ matrix.php-version }}
coverage: xdebug
extension-csv: dom, json, libxml, mbstring, xml, xmlwriter
ini-values-csv: assert.exception=1, zend.assertions=1

- name: "Cache dependencies installed with composer"
uses: actions/cache@v1
with:
path: ~/.composer/cache
key: ${{ matrix.php-binary }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }}
key: php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }}
restore-keys: |
${{ matrix.php-binary }}-composer-${{ matrix.dependencies }}-
php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-
- name: Install lowest dependencies with composer
if: matrix.dependencies == 'lowest'
run: ${{ matrix.php-binary }} ./tools/composer update --no-ansi --no-interaction --no-progress --no-suggest --prefer-lowest
run: ./tools/composer update --no-ansi --no-interaction --no-progress --no-suggest --prefer-lowest

- name: Install highest dependencies with composer
if: matrix.dependencies == 'highest'
run: ${{ matrix.php-binary }} ./tools/composer update --no-ansi --no-interaction --no-progress --no-suggest
run: ./tools/composer update --no-ansi --no-interaction --no-progress --no-suggest

- name: Run sanity check
run: PHP_BINARY=${{ matrix.php-binary }} bash ./build/scripts/sanity-check
run: bash ./build/scripts/sanity-check

- name: Run tests with phpunit
run: ${{ matrix.php-binary }} -d assert.exception=1 -d zend.assertions=1 ./phpunit --coverage-clover=coverage.xml
run: ./phpunit --coverage-clover=coverage.xml

- name: Send code coverage report to Codecov.io
env:
Expand Down

0 comments on commit cfa81d1

Please sign in to comment.