Skip to content

Commit

Permalink
Merge branch 'release/2.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
DannyvdSluijs committed Jan 28, 2021
2 parents eca7bc7 + 2ee448f commit 6141406
Show file tree
Hide file tree
Showing 8 changed files with 127 additions and 59 deletions.
103 changes: 103 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: Build

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

jobs:
build:
name: PHP ${{ matrix.name }}
strategy:
matrix:
include:
- php: 7.2
allow_fail: false
name: 'PHP 7.2 with latest deps'
- php: 7.2
allow_fail: false
composer_update_flags: '--prefer-lowest --prefer-stable'
name: 'PHP 7.2 with lowest stable deps'
- php: 7.3
allow_fail: false
name: 'PHP 7.3 with latest deps'
- php: 7.3
allow_fail: false
composer_update_flags: '--prefer-lowest --prefer-stable'
name: 'PHP 7.3 with lowest stable deps'
- php: 7.4
allow_fail: false
name: 'PHP 7.4 with latest deps'
- php: 7.4
allow_fail: false
composer_update_flags: '--prefer-lowest --prefer-stable'
name: 'PHP 7.4 with lowest stable deps'
- php: 8.0
allow_fail: false
php_ini: 'xdebug.coverage_enable=On'
name: 'PHP 8.0 with latest deps'
- php: 8.0
allow_fail: false
composer_update_flags: '--prefer-lowest --prefer-stable'
php_ini: 'xdebug.coverage_enable=On'
name: 'PHP 8.0 with lowest stable deps'
- php: 8.1
allow_fail: true
php_ini: 'xdebug.coverage_enable=On'
name: 'PHP 8.1 with latest deps'
- php: 8.1
allow_fail: true
composer_update_flags: '--prefer-lowest --prefer-stable'
php_ini: 'xdebug.coverage_enable=On'
name: 'PHP 8.1 with lowest stable deps'

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

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

- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: xdebug
ini-values: ${{ matrix.php_ini }}

- name: Install dependencies
run: composer install ${{ matrix.composer_flags }}
continue-on-error: ${{ matrix.allow_fail }}

- name: Update dependencies
if: matrix.composer_update_flags
run: composer update ${{ matrix.composer_update_flags }} && composer update phpunit/phpunit --with-dependencies
continue-on-error: ${{ matrix.allow_fail }}

- name: Create log folder
run: mkdir -p build/logs;

- name: Run unit tests
run: composer unit-tests
continue-on-error: ${{ matrix.allow_fail }}

- name: Upload test coverage
run: php vendor/bin/php-coveralls -vvv
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: true
COVERALLS_FLAG_NAME: ${{ matrix.name }}
continue-on-error: ${{ matrix.allow_fail }}

finish:
needs: build
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
run: |
curl --header "Content-Type: application/json" \
--request POST \
--data '{"repo_token":"${{ secrets.GITHUB_TOKEN }}","repo_name":"JsonMapper/LaravelPackage", "payload": {"build_num": "${{ github.sha }}", "status": "done"}}' \
https://coveralls.io/webhook
2 changes: 1 addition & 1 deletion .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ pull_request_rules:
- name: automatic merge for Dependabot pull requests
conditions:
- author~=^dependabot(|-preview)\[bot\]$
- status-success=Travis CI - Pull Request
- status-success=Build
actions:
merge:
method: squash
50 changes: 0 additions & 50 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 @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [2.1.0] - 2021-01-28
### Changed
- Migrate to GitHub actions [PR#12](https://github.com/JsonMapper/LaravelPackage/pull/12)

## [2.0.0] - 2021-01-07
### Changed
- Update to version ^2.0 JsonMapper
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ For more information see the project website: https://jsonmapper.net
![GitHub](https://img.shields.io/github/license/JsonMapper/LaravelPackage)
![Packagist Version](https://img.shields.io/packagist/v/json-mapper/laravel-package)
![PHP from Packagist](https://img.shields.io/packagist/php-v/json-mapper/laravel-package)
[![Build Status](https://api.travis-ci.com/JsonMapper/LaravelPackage.svg?branch=master)](https://travis-ci.com/JsonMapper/LaravelPackage)
![Build](https://github.com/JsonMapper/LaravelPackage/workflows/Build/badge.svg?branch=master)
[![Coverage Status](https://coveralls.io/repos/github/JsonMapper/LaravelPackage/badge.svg?branch=master)](https://coveralls.io/github/JsonMapper/LaravelPackage?branch=master)

# Why use JsonMapper
Expand Down
2 changes: 1 addition & 1 deletion Version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.0
2.1.0
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@
"require-dev": {
"squizlabs/php_codesniffer": "^3.5",
"phpstan/phpstan": "^0.12.19",
"php-coveralls/php-coveralls": "^2.2",
"phpunit/phpunit": "^8.0 || ^9.0",
"orchestra/testbench": "^5.3|^6.0"
"orchestra/testbench": "^5.3|^6.0",
"php-coveralls/php-coveralls": "^2.4",
"guzzlehttp/guzzle": "^6.5 || ^7.0"
}
}
18 changes: 14 additions & 4 deletions tests/Unit/ServiceProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,16 @@ public function testBootPublishesConfig(): void
}

/**
* @covers \JsonMapper\LaravelPackage\ServiceProvider
* @covers \JsonMapper\LaravelPackage\ServiceProvider
* @dataProvider configOptionsDataProvider
* @param string|null $type
*/
public function testRegisterMakesJsonMapperAvailableInApp(): void
public function testRegisterMakesJsonMapperAvailableInApp($type): void
{
$app = new \Illuminate\Foundation\Application();
$app->offsetSet('config', new Repository());
$app->offsetSet('config', new Repository(['json-mapper.type' => $type]));
$serviceProvider = new ServiceProvider($app);


$serviceProvider->register();

self::assertTrue($app->has(JsonMapperInterface::class));
Expand All @@ -45,4 +46,13 @@ public function testRegisterMakesJsonMapperAvailableInApp(): void
self::assertTrue($app->has(JsonMapper::class));
self::assertInstanceOf(JsonMapper::class, $app->make(JsonMapper::class));
}

public function configOptionsDataProvider(): array
{
return [
'default' => ['default'],
'best-fit' => ['best-fit'],
'unspecified' => [null],
];
}
}

0 comments on commit 6141406

Please sign in to comment.