Skip to content

Commit 56b9589

Browse files
committed
Try GitHub actions
1 parent e0140f8 commit 56b9589

File tree

4 files changed

+59
-92
lines changed

4 files changed

+59
-92
lines changed

.github/workflows/build.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: build
2+
3+
on: [push, pull_request]
4+
5+
env:
6+
DEFAULT_COMPOSER_FLAGS: "--prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi"
7+
8+
jobs:
9+
phpunit:
10+
name: PHP ${{ matrix.php }} on ${{ matrix.os }}
11+
runs-on: ${{ matrix.os }}
12+
services:
13+
mongodb:
14+
image: mongo
15+
ports:
16+
- 27017:27017
17+
command:
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
os: [ubuntu-latest]
22+
php: ['5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0']
23+
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v2
27+
- name: Install PHP
28+
uses: shivammathur/setup-php@v2
29+
with:
30+
php-version: ${{ matrix.php }}
31+
tools: pecl
32+
extensions: curl, dom, intl, mbstring, mcrypt, pdo, mongodb
33+
ini-values: date.timezone='UTC'
34+
- name: Get composer cache directory
35+
id: composer-cache
36+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
37+
- name: Cache composer dependencies
38+
uses: actions/cache@v1
39+
with:
40+
path: ${{ steps.composer-cache.outputs.dir }}
41+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
42+
restore-keys: ${{ runner.os }}-composer-
43+
- name: Install dependencies
44+
run: composer update $DEFAULT_COMPOSER_FLAGS
45+
- name: PHP Unit tests for PHP 7.1
46+
run: vendor/bin/phpunit --verbose --coverage-clover=coverage.clover --colors=always
47+
if: matrix.php == '7.1'
48+
- name: PHP Unit tests for PHP >= 7.2
49+
run: vendor/bin/phpunit --verbose --colors=always
50+
if: matrix.php >= '7.2'
51+
- name: PHP Unit tests for PHP <= 7.0
52+
run: vendor/bin/phpunit --verbose --colors=always
53+
if: matrix.php <= '7.0'
54+
- name: Code coverage
55+
run: |
56+
wget https://scrutinizer-ci.com/ocular.phar
57+
php ocular.phar code-coverage:upload --format=php-clover coverage.clover
58+
if: matrix.php == '7.1'
59+
continue-on-error: true # if is fork

.travis.yml

Lines changed: 0 additions & 61 deletions
This file was deleted.

tests/data/travis/README.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

tests/data/travis/mongodb-setup.sh

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)