Skip to content

Created GitHub "tests" action #17822

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 119 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
name: Tests

on: [push, pull_request]

env:
DEFAULT_COMPOSER_FLAGS: "--prefer-dist --no-interaction --no-progress --optimize-autoloader"
PHPUNIT_EXCLUDE_GROUP: mssql,oci,wincache,xcache,zenddata,cubrid

jobs:
phpunit:
name: PHP ${{ matrix.php }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
# services:
# mysql:
# image: mysql
# env:
# MYSQL_ALLOW_EMPTY_PASSWORD: false
# MYSQL_ROOT_PASSWORD: root
# MYSQL_DATABASE: yiitest
# ports:
# - 3306/tcp
# options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
# postgres:
# image: postgres:9.6
# env:
# POSTGRES_USER: postgres
# POSTGRES_PASSWORD:
# POSTGRES_DB: yiitest
# ports:
# - 5432/tcp
# options: --name=postgres --health-cmd="pg_isready" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
php: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4']

steps:
- name: Generate french locale
run: sudo locale-gen fr_FR.UTF-8
- name: Checkout
uses: actions/checkout@v2
- name: Install PHP
uses: shivammathur/setup-php@v1
with:
php-version: ${{ matrix.php }}
extensions: apc, curl, mbstring, dom, intl, mysql, pgsql, memcached, pdo, pdo_sqlite, imagick
ini-values: date.timezone='UTC'
- name: Install Memcached
uses: niden/actions-memcached@v7
- name: Install Postgres
uses: harmon758/postgresql-action@v1
with:
postgresql version: 9.6
postgresql db: yiitest
postgresql user: postgres
- name: Create mysql db
run: mysql -uroot -proot -e 'CREATE DATABASE `yiitest`;'
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: composer update $DEFAULT_COMPOSER_FLAGS
- name: PHP Unit tests
run: vendor/bin/phpunit --verbose --coverage-clover=coverage.clover --exclude-group oci,wincache,xcache,zenddata,cubrid
if: matrix.php == '7.1'
- name: PHP Unit tests
run: vendor/bin/phpunit --verbose --exclude-group $PHPUNIT_EXCLUDE_GROUP
env:
PHPUNIT_EXCLUDE_GROUP: oci,wincache,xcache,zenddata,cubrid
if: matrix.php == '7.4' || matrix.php == '7.3' || matrix.php == '7.2'
- name: PHP Unit tests
run: vendor/bin/phpunit --verbose --exclude-group $PHPUNIT_EXCLUDE_GROUP
if: matrix.php == '7.0' || matrix.php == '5.6'
- name: Code coverage
run: |
wget https://scrutinizer-ci.com/ocular.phar
php ocular.phar code-coverage:upload --format=php-clover coverage.clover
if: matrix.php == '7.1'
continue-on-error: true # if is fork

npm:
name: NPM 6 on ubuntu-latest
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install PHP
uses: shivammathur/setup-php@v1
with:
php-version: 7.2
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: composer update $DEFAULT_COMPOSER_FLAGS
- name: Install node.js
uses: actions/setup-node@v1
with:
node-version: 6
- name: Tests
run: |
npm install
npm test
# env:
# CI: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# phpstorm project files
.idea
*.iml

# netbeans project files
nbproject
Expand Down
File renamed without changes.