Fix error in installing packages in build.yml #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
permissions: | |
contents: read | |
jobs: | |
run: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php-versions: ['5.3', '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4'] | |
name: Run Unit Test on PHP ${{ matrix.php-versions }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Install PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-versions }} | |
- name: Check the PHP version | |
run: php -v | |
- name: Validate composer.json and composer.lock | |
run: composer validate --strict | |
- name: Install dependencies | |
run: composer install --prefer-dist --no-progress | |
- name: Install packages not specified for PHP 5.3 | |
run: if [[ ${{ steps.setup-php.outputs.php-version }} != '5.3' ]]; then composer require league/container:~2.4 nikic/fast-route phroute/phroute zendframework/zend-diactoros zendframework/zend-stratigility --dev; fi | |
- name: Install packages for PHP 7.1 | |
run: if [[ ${{ steps.setup-php.outputs.php-version }} == '7.1' ]]; then composer require zendframework/zend-stratigility:~2.0 && composer update --dev; fi | |
- name: Install packages for PHP 7.2 | |
run: if [[ ${{ steps.setup-php.outputs.php-version }} == '7.2' ]]; then composer require zendframework/zend-stratigility:~2.0 && composer update --dev; fi | |
- name: Install packages for PHP 7.3 | |
run: if [[ ${{ steps.setup-php.outputs.php-version }} == '7.3' ]]; then composer require zendframework/zend-stratigility:~2.0 && composer update --dev; fi | |
- name: Install packages for PHP 7.4 | |
run: if [[ ${{ steps.setup-php.outputs.php-version }} == '7.4' ]]; then composer require zendframework/zend-stratigility:~2.0 && composer update --dev; fi | |
- name: Run test suite | |
run: vendor/bin/phpunit |