Add run-tests workflow

This commit is contained in:
Oliver Davies 2020-03-01 18:50:50 +00:00
parent 37c48b07e6
commit 7db076efdb
3 changed files with 49 additions and 2 deletions

47
.github/workflows/run-tests.yml vendored Normal file
View file

@ -0,0 +1,47 @@
name: Run tests
on:
push:
schedule:
- cron: '0 0 * * *'
jobs:
tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
php: [7.4, 7.3, 7.2]
dependency-version: [prefer-lowest, prefer-stable]
os: [ubuntu-latest, windows-latest]
name: "PHP ${{ matrix.php }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}"
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Cache dependencies
uses: actions/cache@v1
with:
path: ~/.composer/cache/files
key: dependencies-composer-${{ hashFiles('composer.json') }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mbstring
coverage: none
- name: Install Composer dependencies
run: |
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
composer update sebastian/comparator
- name: Configure matchers
uses: mheap/phpunit-matcher-action@master
- name: Execute tests
run: vendor/bin/phpunit --teamcity

View file

@ -3,7 +3,7 @@
namespace Opdavies\GmailFilterBuilder\Service;
use Opdavies\GmailFilterBuilder\Exception\PartialNotFoundException;
use Tightenco\Collect\Support\Collection;
use Illuminate\Support\Collection;
/**
* A service for loading addresses from separate files.

View file

@ -5,7 +5,7 @@ namespace Opdavies\Tests\GmailFilterBuilder\Service;
use Opdavies\GmailFilterBuilder\Exception\PartialNotFoundException;
use Opdavies\GmailFilterBuilder\Service\Addresses;
use PHPUnit\Framework\TestCase;
use Tightenco\Collect\Support\Collection;
use Illuminate\Support\Collection;
/**
* Test loading addresses from a separate file.