Skip to content

Commit 6141406

Browse files
committed
Merge branch 'release/2.1.0'
2 parents eca7bc7 + 2ee448f commit 6141406

File tree

8 files changed

+127
-59
lines changed

8 files changed

+127
-59
lines changed

.github/workflows/build.yaml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [ develop, master ]
6+
pull_request:
7+
branches: [ develop, master ]
8+
9+
jobs:
10+
build:
11+
name: PHP ${{ matrix.name }}
12+
strategy:
13+
matrix:
14+
include:
15+
- php: 7.2
16+
allow_fail: false
17+
name: 'PHP 7.2 with latest deps'
18+
- php: 7.2
19+
allow_fail: false
20+
composer_update_flags: '--prefer-lowest --prefer-stable'
21+
name: 'PHP 7.2 with lowest stable deps'
22+
- php: 7.3
23+
allow_fail: false
24+
name: 'PHP 7.3 with latest deps'
25+
- php: 7.3
26+
allow_fail: false
27+
composer_update_flags: '--prefer-lowest --prefer-stable'
28+
name: 'PHP 7.3 with lowest stable deps'
29+
- php: 7.4
30+
allow_fail: false
31+
name: 'PHP 7.4 with latest deps'
32+
- php: 7.4
33+
allow_fail: false
34+
composer_update_flags: '--prefer-lowest --prefer-stable'
35+
name: 'PHP 7.4 with lowest stable deps'
36+
- php: 8.0
37+
allow_fail: false
38+
php_ini: 'xdebug.coverage_enable=On'
39+
name: 'PHP 8.0 with latest deps'
40+
- php: 8.0
41+
allow_fail: false
42+
composer_update_flags: '--prefer-lowest --prefer-stable'
43+
php_ini: 'xdebug.coverage_enable=On'
44+
name: 'PHP 8.0 with lowest stable deps'
45+
- php: 8.1
46+
allow_fail: true
47+
php_ini: 'xdebug.coverage_enable=On'
48+
name: 'PHP 8.1 with latest deps'
49+
- php: 8.1
50+
allow_fail: true
51+
composer_update_flags: '--prefer-lowest --prefer-stable'
52+
php_ini: 'xdebug.coverage_enable=On'
53+
name: 'PHP 8.1 with lowest stable deps'
54+
55+
runs-on: ubuntu-latest
56+
57+
steps:
58+
- uses: actions/checkout@v2
59+
60+
- name: Validate composer.json and composer.lock
61+
run: composer validate
62+
63+
- name: Setup PHP ${{ matrix.php }}
64+
uses: shivammathur/setup-php@v2
65+
with:
66+
php-version: ${{ matrix.php }}
67+
coverage: xdebug
68+
ini-values: ${{ matrix.php_ini }}
69+
70+
- name: Install dependencies
71+
run: composer install ${{ matrix.composer_flags }}
72+
continue-on-error: ${{ matrix.allow_fail }}
73+
74+
- name: Update dependencies
75+
if: matrix.composer_update_flags
76+
run: composer update ${{ matrix.composer_update_flags }} && composer update phpunit/phpunit --with-dependencies
77+
continue-on-error: ${{ matrix.allow_fail }}
78+
79+
- name: Create log folder
80+
run: mkdir -p build/logs;
81+
82+
- name: Run unit tests
83+
run: composer unit-tests
84+
continue-on-error: ${{ matrix.allow_fail }}
85+
86+
- name: Upload test coverage
87+
run: php vendor/bin/php-coveralls -vvv
88+
env:
89+
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
90+
COVERALLS_PARALLEL: true
91+
COVERALLS_FLAG_NAME: ${{ matrix.name }}
92+
continue-on-error: ${{ matrix.allow_fail }}
93+
94+
finish:
95+
needs: build
96+
runs-on: ubuntu-latest
97+
steps:
98+
- name: Coveralls Finished
99+
run: |
100+
curl --header "Content-Type: application/json" \
101+
--request POST \
102+
--data '{"repo_token":"${{ secrets.GITHUB_TOKEN }}","repo_name":"JsonMapper/LaravelPackage", "payload": {"build_num": "${{ github.sha }}", "status": "done"}}' \
103+
https://coveralls.io/webhook

.mergify.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ pull_request_rules:
22
- name: automatic merge for Dependabot pull requests
33
conditions:
44
- author~=^dependabot(|-preview)\[bot\]$
5-
- status-success=Travis CI - Pull Request
5+
- status-success=Build
66
actions:
77
merge:
88
method: squash

.travis.yml

Lines changed: 0 additions & 50 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
## [2.1.0] - 2021-01-28
10+
### Changed
11+
- Migrate to GitHub actions [PR#12](https://github.com/JsonMapper/LaravelPackage/pull/12)
12+
913
## [2.0.0] - 2021-01-07
1014
### Changed
1115
- Update to version ^2.0 JsonMapper

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ For more information see the project website: https://jsonmapper.net
99
![GitHub](https://img.shields.io/github/license/JsonMapper/LaravelPackage)
1010
![Packagist Version](https://img.shields.io/packagist/v/json-mapper/laravel-package)
1111
![PHP from Packagist](https://img.shields.io/packagist/php-v/json-mapper/laravel-package)
12-
[![Build Status](https://api.travis-ci.com/JsonMapper/LaravelPackage.svg?branch=master)](https://travis-ci.com/JsonMapper/LaravelPackage)
12+
![Build](https://github.com/JsonMapper/LaravelPackage/workflows/Build/badge.svg?branch=master)
1313
[![Coverage Status](https://coveralls.io/repos/github/JsonMapper/LaravelPackage/badge.svg?branch=master)](https://coveralls.io/github/JsonMapper/LaravelPackage?branch=master)
1414

1515
# Why use JsonMapper

Version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.0.0
1+
2.1.0

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@
4242
"require-dev": {
4343
"squizlabs/php_codesniffer": "^3.5",
4444
"phpstan/phpstan": "^0.12.19",
45-
"php-coveralls/php-coveralls": "^2.2",
4645
"phpunit/phpunit": "^8.0 || ^9.0",
47-
"orchestra/testbench": "^5.3|^6.0"
46+
"orchestra/testbench": "^5.3|^6.0",
47+
"php-coveralls/php-coveralls": "^2.4",
48+
"guzzlehttp/guzzle": "^6.5 || ^7.0"
4849
}
4950
}

tests/Unit/ServiceProviderTest.php

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,16 @@ public function testBootPublishesConfig(): void
2828
}
2929

3030
/**
31-
* @covers \JsonMapper\LaravelPackage\ServiceProvider
31+
* @covers \JsonMapper\LaravelPackage\ServiceProvider
32+
* @dataProvider configOptionsDataProvider
33+
* @param string|null $type
3234
*/
33-
public function testRegisterMakesJsonMapperAvailableInApp(): void
35+
public function testRegisterMakesJsonMapperAvailableInApp($type): void
3436
{
3537
$app = new \Illuminate\Foundation\Application();
36-
$app->offsetSet('config', new Repository());
38+
$app->offsetSet('config', new Repository(['json-mapper.type' => $type]));
3739
$serviceProvider = new ServiceProvider($app);
3840

39-
4041
$serviceProvider->register();
4142

4243
self::assertTrue($app->has(JsonMapperInterface::class));
@@ -45,4 +46,13 @@ public function testRegisterMakesJsonMapperAvailableInApp(): void
4546
self::assertTrue($app->has(JsonMapper::class));
4647
self::assertInstanceOf(JsonMapper::class, $app->make(JsonMapper::class));
4748
}
49+
50+
public function configOptionsDataProvider(): array
51+
{
52+
return [
53+
'default' => ['default'],
54+
'best-fit' => ['best-fit'],
55+
'unspecified' => [null],
56+
];
57+
}
4858
}

0 commit comments

Comments
 (0)