Skip to content

Use ubuntu-latest

Use ubuntu-latest #56

Workflow file for this run

on:
- pull_request
- push
name: build
jobs:
tests:
name: PHP ${{ matrix.php }}-${{ matrix.os }}
env:
extensions: pdo, pdo_mysql
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"
steps:
- name: Checkout
uses: actions/[email protected]
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ env.extensions }}
ini-values: date.timezone='UTC'
coverage: pcov
tools: composer:v2
- name: Update composer
run: composer self-update
- name: Install dependencies with composer php < 8.0
if: matrix.php != '8.0'
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
- name: Install dependencies with composer php 8.0
if: matrix.php == '8.0'
run: composer update --ignore-platform-reqs --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
- name: Setup source database
run: |
sudo /etc/init.d/mysql start
mysql -uroot -proot -e 'CREATE DATABASE `yiitest`;'
mysql -D yiitest -uroot -proot < tests/data/source.sql
- name: Install sphinx
run: cd tests/data/actions && sh sphinx-setup.sh
- name: Run tests with phpunit
if: matrix.php != '7.4'
run: vendor/bin/phpunit --colors=always
- name: Run tests with phpunit
if: matrix.php == '7.4'
run: vendor/bin/phpunit --coverage-clover=clover.xml --colors=always
- 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