Skip to content

Commit

Permalink
Add github actions for testing (#101)
Browse files Browse the repository at this point in the history
* Add github actions for testing

* Add test

* Upgrade PHPUnit

* unit tests run with PHP 8

Co-authored-by: Joe Green <[email protected]>
  • Loading branch information
mrjgreen and joegreenana authored May 4, 2022
1 parent 3cc5ae4 commit 1385121
Show file tree
Hide file tree
Showing 8 changed files with 206 additions and 181 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Phroute Build

on:
push:
branches: [master]
pull_request:
branches: [master]

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Create build output folder
run: mkdir -p build/logs

- name: Run test suite
run: XDEBUG_MODE=coverage php vendor/bin/phpunit --coverage-clover build/logs/clover.xml

- name: Generate coverage
run: php vendor/bin/coveralls -v
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
vendor
composer.lock
.phpunit.result.cache
17 changes: 0 additions & 17 deletions .travis.yml

This file was deleted.

Loading

0 comments on commit 1385121

Please sign in to comment.