Skip to content

Commit

Permalink
Switch to GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
sebdesign committed Dec 10, 2020
1 parent 9a451dd commit fd286c5
Show file tree
Hide file tree
Showing 9 changed files with 118 additions and 93 deletions.
File renamed without changes.
98 changes: 98 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: Tests

on:
push:
pull_request:
schedule:
- cron: '0 0 * * *'

jobs:
tests:
runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
php: [8.0, 7.4, 7.3, 7.2, 7.1]
laravel: [^8.0, ^7.0, ^6.0, 5.8.*, 5.7.*, 5.6.*, 5.5.*]
include:
- laravel: ^8.0
testbench: ^6.0
phpunit: 9.3
- laravel: ^7.0
testbench: ^5.0
phpunit: 8.5
- laravel: ^6.0
testbench: ^4.0
phpunit: 8.5
- laravel: 5.8.*
testbench: ^3.8
phpunit: 7.5
- laravel: 5.7.*
testbench: ^3.7
phpunit: 7.0
- laravel: 5.6.*
testbench: ^3.6
phpunit: 7.0
- laravel: 5.5.*
testbench: ^3.5
phpunit: 6.0
exclude:
- laravel: ^8.0
php: 7.2
- laravel: ^8.0
php: 7.1
- laravel: ^7.0
php: 7.1
- laravel: ^6.0
php: 7.1
- laravel: 5.8.*
php: 8.0
- laravel: 5.7.*
php: 8.0
- laravel: 5.7.*
php: 7.4
- laravel: 5.6.*
php: 8.0
- laravel: 5.6.*
php: 7.4
- laravel: 5.6.*
php: 7.3
- laravel: 5.5.*
php: 8.0
- laravel: 5.5.*
php: 7.4

name: P${{ matrix.php }} - L${{ matrix.laravel }}

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip
tools: composer:v2
coverage: pcov

- name: Install dependencies
run: |
composer require "illuminate/console:${{ matrix.laravel }}" "illuminate/support:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "phpunit/phpunit:^${{ matrix.phpunit }}" --no-interaction --no-update
composer update --prefer-dist --no-interaction --no-progress
- name: Setup PCOV
if: ${{ matrix.phpunit < 8 }}
run: |
composer require pcov/clobber
vendor/bin/pcov clobber
- name: Execute tests
run: vendor/bin/phpunit --verbose --whitelist=src --coverage-clover=build/coverage/coverage.clover

- name: Upload coverage
if: ${{ matrix.php < 8 }}
run: |
wget https://scrutinizer-ci.com/ocular.phar
php ocular.phar code-coverage:upload --format=php-clover build/coverage/coverage.clover
74 changes: 0 additions & 74 deletions .travis.yml

This file was deleted.

4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to `artisan-cloudflare` will be documented in this file.

## 2.4.3 - 2020-12-09

- Switch to GitHub Actions

## 2.4.2 - 2020-11-30

- Add support for PHP 8
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

[![Latest Version on Packagist](https://img.shields.io/packagist/v/sebdesign/artisan-cloudflare.svg?style=flat-square)](https://packagist.org/packages/sebdesign/artisan-cloudflare)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)
[![Build Status](https://img.shields.io/travis/sebdesign/artisan-cloudflare/master.svg?style=flat-square)](https://travis-ci.org/sebdesign/artisan-cloudflare)
[![Build Status](https://img.shields.io/github/workflow/status/sebdesign/artisan-cloudflare/Tests/master?style=flat-square)](https://github.com/sebdesign/artisan-cloudflare/actions)
[![Quality Score](https://img.shields.io/scrutinizer/g/sebdesign/artisan-cloudflare.svg?style=flat-square)](https://scrutinizer-ci.com/g/sebdesign/artisan-cloudflare)
[![Scrutinizer Coverage](https://img.shields.io/scrutinizer/coverage/g/sebdesign/artisan-cloudflare.svg?style=flat-square)]()
[![Scrutinizer Coverage](https://img.shields.io/scrutinizer/coverage/g/sebdesign/artisan-cloudflare.svg?style=flat-square)](https://scrutinizer-ci.com/g/sebdesign/artisan-cloudflare)
[![StyleCI](https://styleci.io/repos/74228812/shield?style=flat-square)](https://styleci.io/repos/74228812)

Laravel artisan commands for interacting with the CloudFlare API.
Expand Down Expand Up @@ -160,7 +160,7 @@ composer test

## Contributing

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

## Security

Expand Down
12 changes: 0 additions & 12 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,4 @@
<directory>tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">src/</directory>
</whitelist>
</filter>
<logging>
<log type="tap" target="build/report.tap"/>
<log type="junit" target="build/report.junit.xml"/>
<log type="coverage-html" target="build/coverage"/>
<log type="coverage-text" target="build/coverage.txt"/>
<log type="coverage-clover" target="build/logs/clover.xml"/>
</logging>
</phpunit>
2 changes: 1 addition & 1 deletion src/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ protected function registerMacros()

$params = array_merge([function () use ($keys) {
return new static(array_combine($keys, func_get_args()));
}], $this->toArray());
}], $this->values()->toArray());

return new static(call_user_func_array('array_map', $params));
});
Expand Down
10 changes: 8 additions & 2 deletions tests/ConsoleHelpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
namespace Sebdesign\ArtisanCloudflare\Test;

use Illuminate\Contracts\Console\Kernel;
use PHPUnit\Framework\Constraint\LogicalNot;
use PHPUnit\Framework\Constraint\StringContains;

trait ConsoleHelpers
{
Expand Down Expand Up @@ -43,7 +45,9 @@ public function artisan($command, $parameters = [])
*/
protected function seeInConsole($text)
{
$this->assertStringContainsString($text, $this->output);
$constraint = new StringContains($text, false);

$this->assertThat($this->output, $constraint);

return $this;
}
Expand All @@ -56,7 +60,9 @@ protected function seeInConsole($text)
*/
protected function dontSeeInConsole($text)
{
$this->assertStringNotContainsString($text, $this->output);
$constraint = new LogicalNot(new StringContains($text));

static::assertThat($this->output, $constraint);

return $this;
}
Expand Down
5 changes: 4 additions & 1 deletion tests/GuzzleHelpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use GuzzleHttp\Psr7\Request;
use GuzzleHttp\Psr7\Response;
use Illuminate\Support\Collection;
use PHPUnit\Framework\Constraint\StringContains;
use Sebdesign\ArtisanCloudflare\Client;

trait GuzzleHelpers
Expand All @@ -35,7 +36,9 @@ trait GuzzleHelpers
*/
protected function seeRequestContainsPath(array $transaction, $path)
{
$this->assertStringContainsString($path, $transaction['request']->getUri()->getPath());
$constraint = new StringContains($path, false);

$this->assertThat($transaction['request']->getUri()->getPath(), $constraint);

return $this;
}
Expand Down

0 comments on commit fd286c5

Please sign in to comment.