Skip to content

Commit

Permalink
Merge pull request #112 from demiankatz/github-actions
Browse files Browse the repository at this point in the history
Switch to GitHub Actions.
  • Loading branch information
svycka authored Nov 18, 2022
2 parents 7357acd + b50b8b0 commit 8f2bd20
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 46 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: CI

on: [push, pull_request]

jobs:
run-tests:
name: Tests with PHP ${{ matrix.php-version }} (Composer ${{ matrix.dependencies }})
runs-on: ubuntu-latest
strategy:
matrix:
include:
- php-version: 7.4
dependencies: "--prefer-stable"
test_coverage: "yes"
- php-version: 7.4
dependencies: "--prefer-lowest --prefer-stable"
test_coverage: "no"
# - php-version: 8.0
# dependencies: "--prefer-stable"
# test_coverage: false
# - php-version: 8.0
# dependencies: "--prefer-lowest --prefer-stable"
# test_coverage: false
# - php-version: 8.1
# dependencies: "--prefer-stable"
# test_coverage: false
# - php-version: 8.1
# dependencies: "--prefer-lowest --prefer-stable"
# test_coverage: false

steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: xdebug
tools: composer:2.4.4

- name: Checkout
uses: actions/checkout@v3

- name: Install composer dependencies
run: composer update --prefer-source ${{ matrix.dependencies }}

- name: Run php-cs-fixer
run: vendor/bin/php-cs-fixer fix -v --diff --dry-run

- name: Run tests (without coverage)
if: ${{ matrix.test_coverage == 'no' }}
run: vendor/bin/phpunit

- name: Run tests (with coverage)
if: ${{ matrix.test_coverage == 'yes' }}
run: php -dzend_extension=xdebug.so ./vendor/bin/phpunit --coverage-text --coverage-clover ./build/logs/clover.xml

- name: Run coveralls
if: ${{ matrix.test_coverage == 'yes' }}
run: vendor/bin/coveralls
42 changes: 0 additions & 42 deletions .travis.yml

This file was deleted.

9 changes: 5 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@
"laminas/laminas-view": "^2.9.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.16.1",
"phpunit/phpunit": "^8.5.1",
"satooshi/php-coveralls": "^1.1.0",
"friendsofphp/php-cs-fixer": "^2.19.3",
"laminas/laminas-console": "^2.6",
"laminas/laminas-mvc": "^3.1",
"laminas/laminas-mvc-console": "^1.1.9"
"laminas/laminas-mvc-console": "^1.1.9",
"phpspec/prophecy": "^1.15",
"phpunit/phpunit": "^8.5.1",
"satooshi/php-coveralls": "^1.1.0"
},
"suggest": {
"laminas/laminas-mvc": "For using the router in the UriPath strategy"
Expand Down

0 comments on commit 8f2bd20

Please sign in to comment.