Skip to content

Commit 1ba9f58

Browse files
authored
[CI] Migrate to GH actions (#399)
No coverage for now, can come later
1 parent ce7aeed commit 1ba9f58

File tree

6 files changed

+121
-97
lines changed

6 files changed

+121
-97
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: "CI"
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
jobs:
10+
phpunit:
11+
name: "PHPUnit"
12+
runs-on: "ubuntu-latest"
13+
env:
14+
SYMFONY_REQUIRE: ${{matrix.symfony-require}}
15+
SYMFONY_DEPRECATIONS_HELPER: ${{matrix.symfony-deprecations-helper}}
16+
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
include:
21+
# Minimum supported Symfony version and lowest PHP version
22+
- dependencies: "php-http/guzzle7-adapter"
23+
php-version: "7.3"
24+
dependency-versions: "lowest"
25+
symfony-deprecations-helper: "weak"
26+
27+
# Test the latest stable release
28+
- dependencies: "php-http/guzzle7-adapter php-http/vcr-plugin:^1.0@dev"
29+
php-version: "7.3"
30+
symfony-deprecations-helper: "weak"
31+
- dependencies: "php-http/guzzle6-adapter"
32+
php-version: "7.4"
33+
symfony-deprecations-helper: "weak"
34+
- dependencies: "php-http/guzzle6-adapter"
35+
php-version: "8.0"
36+
symfony-deprecations-helper: "weak"
37+
38+
# Test with httplug 1.x clients
39+
- dependencies: "php-http/buzz-adapter:^1.0 php-http/guzzle6-adapter:^1.1.1 php-http/react-adapter:^0.2.1 php-http/socket-client:^1.0"
40+
php-version: "7.3"
41+
symfony-deprecations-helper: "weak"
42+
# Test with httplug 2.x clients
43+
- dependencies: "php-http/guzzle7-adapter php-http/curl-client:^2.0.0 php-http/vcr-plugin:^1.0@dev"
44+
php-version: "7.3"
45+
symfony-deprecations-helper: "weak"
46+
47+
# Latest commit to master
48+
- dependencies: "php-http/guzzle7-adapter php-http/vcr-plugin:^1.0@dev"
49+
php-version: "8.0"
50+
stability: "dev"
51+
symfony-deprecations-helper: "weak"
52+
- dependencies: "php-http/guzzle7-adapter"
53+
php-version: "8.0"
54+
stability: "dev"
55+
symfony-deprecations-helper: "weak"
56+
57+
# Test maintained versions of Symfony
58+
- dependencies: "php-http/guzzle6-adapter"
59+
symfony-require: "3.4.*"
60+
php-version: "7.3"
61+
symfony-deprecations-helper: "weak"
62+
- dependencies: "php-http/guzzle7-adapter symfony/http-client:^4.4"
63+
symfony-require: "4.4.*"
64+
php-version: "7.3"
65+
symfony-deprecations-helper: "weak"
66+
- dependencies: "php-http/guzzle7-adapter symfony/http-client:^5.0"
67+
symfony-require: "5.4.*"
68+
php-version: "7.3"
69+
symfony-deprecations-helper: "weak"
70+
71+
steps:
72+
- name: "Checkout"
73+
uses: "actions/checkout@v2"
74+
with:
75+
fetch-depth: 2
76+
77+
- name: "Install PHP with PCOV"
78+
uses: "shivammathur/setup-php@v2"
79+
with:
80+
php-version: "${{ matrix.php-version }}"
81+
coverage: "pcov"
82+
ini-values: "zend.assertions=1"
83+
84+
- name: "Enforce using stable dependencies"
85+
run: "composer config minimum-stability stable"
86+
if: "${{ matrix.stability == 'stable' }}"
87+
88+
- name: "Install dependencies"
89+
run: "composer require --no-progress --no-scripts --no-plugins symfony/flex ${{ matrix.dependencies }}"
90+
91+
- name: "Install dependencies with Composer"
92+
uses: "ramsey/composer-install@v1"
93+
with:
94+
dependency-versions: "${{ matrix.dependencies }}"
95+
composer-options: "${{ matrix.composer-options }}"
96+
97+
- name: "Run PHPUnit"
98+
run: "composer test"

.github/workflows/static-analysis.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: "Static analysis"
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
jobs:
10+
coding-standards:
11+
name: "Coding Standards"
12+
runs-on: "ubuntu-latest"
13+
14+
steps:
15+
- name: "Checkout"
16+
uses: "actions/checkout@v2"
17+
- name: "PHP-CS-Fixer"
18+
uses: "docker://oskarstark/php-cs-fixer-ga:2.19.0"
19+
with:
20+
args: --diff --dry-run

.scrutinizer.yml

-8
This file was deleted.

.travis.yml

-86
This file was deleted.

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Latest Version](https://img.shields.io/github/release/php-http/HttplugBundle.svg?style=flat-square)](https://github.com/php-http/HttplugBundle/releases)
44
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)
5-
[![Build Status](https://img.shields.io/travis/php-http/HttplugBundle/master.svg?style=flat-square)](https://travis-ci.org/php-http/HttplugBundle)
5+
[![Build Status](https://github.com/php-http/HttplugBundle/actions/workflows/continuous-integration.yml/badge.svg)](https://github.com/php-http/HttplugBundle/actions)
66
[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/php-http/HttplugBundle.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-http/HttplugBundle)
77
[![Quality Score](https://img.shields.io/scrutinizer/g/php-http/HttplugBundle.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-http/HttplugBundle)
88
[![Total Downloads](https://img.shields.io/packagist/dt/php-http/httplug-bundle.svg?style=flat-square)](https://packagist.org/packages/php-http/httplug-bundle)

src/Collector/Twig/HttpMessageMarkupExtension.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ public function markup($message)
7272

7373
public function markupBody(string $body): ?string
7474
{
75-
if (in_array(substr($body, 0, 1), ['{','['], true)) {
75+
if (in_array(substr($body, 0, 1), ['{', '['], true)) {
7676
$json = json_decode($body, true);
77-
if (json_last_error() === JSON_ERROR_NONE) {
77+
if (JSON_ERROR_NONE === json_last_error()) {
7878
$body = $json;
7979
}
8080
}

0 commit comments

Comments
 (0)