Skip to content

Commit 1781400

Browse files
committed
replace Travis CI with GitHub Actions
1 parent 9f39d6c commit 1781400

File tree

3 files changed

+58
-13
lines changed

3 files changed

+58
-13
lines changed

.github/workflows/ci.yaml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: 'CI'
2+
3+
on:
4+
- 'push'
5+
- 'pull_request'
6+
7+
jobs:
8+
tests:
9+
name: 'Tests'
10+
11+
runs-on: 'ubuntu-latest'
12+
13+
strategy:
14+
matrix:
15+
include:
16+
- php-version: '7.1'
17+
composer-options: '--prefer-stable'
18+
- php-version: '7.1'
19+
composer-options: '--prefer-lowest --prefer-stable'
20+
- php-version: '7.2'
21+
composer-options: '--prefer-stable'
22+
- php-version: '7.3'
23+
composer-options: '--prefer-stable'
24+
25+
steps:
26+
- name: 'Check out'
27+
uses: 'actions/checkout@v2'
28+
29+
- name: 'Set up PHP'
30+
uses: 'shivammathur/setup-php@v2'
31+
with:
32+
php-version: '${{ matrix.php-version }}'
33+
coverage: 'none'
34+
35+
- name: 'Get Composer cache directory'
36+
id: 'composer-cache'
37+
run: 'echo "::set-output name=cache-dir::$(composer config cache-files-dir)"'
38+
39+
- name: 'Cache dependencies'
40+
uses: 'actions/cache@v2'
41+
with:
42+
path: '${{ steps.composer-cache.outputs.cache-dir }}'
43+
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
44+
restore-keys: 'php-${{ matrix.php-version }}-composer-locked-'
45+
46+
- name: 'Install dependencies'
47+
run: 'composer update --no-progress $COMPOSER_OPTIONS'
48+
49+
- name: 'Install PHPUnit'
50+
run: 'vendor/bin/simple-phpunit install'
51+
52+
- name: 'Run PhpSpec'
53+
run: 'vendor/bin/phpspec run'
54+
55+
- name: 'Run PHPUnit'
56+
run: 'SYMFONY_DEPRECATIONS_HELPER=weak vendor/bin/simple-phpunit'

.travis.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
1-
sudo: false
2-
31
language: php
42

5-
cache:
6-
directories:
7-
- $HOME/.composer/cache/files
8-
93
env:
104
global:
115
- deps=""
@@ -23,17 +17,11 @@ matrix:
2317
- php: 7.2
2418
- php: 7.3
2519

26-
before_install:
27-
- if [[ "$xdebug" != "yes" ]]; then phpenv config-rm xdebug.ini; fi
28-
- composer self-update
29-
- composer require 'phpunit/phpunit:^4.8.35|^5.4.3|^6.0' --dev --no-update
30-
3120
install:
3221
- if [ "$PACKAGES" != "" ]; then composer require --no-update $PACKAGES; fi
3322
- composer update $COMPOSER_OPTIONS
3423

3524
script:
36-
- vendor/bin/phpspec run
3725
- if [[ "$xdebug" = "yes" ]]; then vendor/bin/phpunit --coverage-clover=coverage.clover; else vendor/bin/phpunit; fi
3826
- if [[ "$xdebug" = "yes" ]]; then wget https://scrutinizer-ci.com/ocular.phar; fi
3927
- if [[ "$xdebug" = "yes" ]]; then php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
"require-dev": {
2929
"phpspec/phpspec": "^2.4",
3030
"php-http/mock-client": "^1.2",
31-
"php-xapi/test-fixtures": "^1.0"
31+
"php-xapi/test-fixtures": "^1.0",
32+
"symfony/phpunit-bridge": "^5.2"
3233
},
3334
"minimum-stability": "dev",
3435
"suggest": {

0 commit comments

Comments
 (0)