Skip to content

Commit 2c1307e

Browse files
Merge pull request #122 from php-http/github-actions
Add GitHub actions
2 parents 74924cb + 209c486 commit 2c1307e

37 files changed

+537
-166
lines changed

.gitattributes

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
1-
.editorconfig export-ignore
2-
.gitattributes export-ignore
3-
/.github/ export-ignore
4-
.gitignore export-ignore
5-
/.php_cs export-ignore
6-
/.scrutinizer.yml export-ignore
7-
/.styleci.yml export-ignore
8-
/.travis.yml export-ignore
9-
/behat.yml.dist export-ignore
10-
/features/ export-ignore
11-
/phpspec.ci.yml export-ignore
12-
/phpspec.yml.dist export-ignore
13-
/phpunit.xml.dist export-ignore
14-
/spec/ export-ignore
15-
/tests/ export-ignore
1+
.editorconfig export-ignore
2+
.gitattributes export-ignore
3+
/.github/ export-ignore
4+
.gitignore export-ignore
5+
/.php_cs.dist export-ignore
6+
/phpspec.ci.yml export-ignore
7+
/phpspec.yml.dist export-ignore
8+
/phpstan-baseline.neon export-ignore
9+
/phpstan.neon.dist export-ignore
10+
/phpunit.xml.dist export-ignore
11+
/spec/ export-ignore
12+
/tests/ export-ignore

.github/workflows/.editorconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[*.yml]
2+
indent_size = 2

.github/workflows/checks.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Checks
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
jobs:
10+
composer-normalize:
11+
name: Composer Normalize
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v1
17+
18+
- name: Install
19+
uses: docker://composer
20+
with:
21+
args: install
22+
23+
- name: Normalize
24+
uses: docker://composer
25+
with:
26+
args: composer normalize --dry-run
27+
28+
roave-bc-check:
29+
name: Roave BC Check
30+
runs-on: ubuntu-latest
31+
32+
steps:
33+
- name: Checkout code
34+
uses: actions/checkout@v1
35+
36+
- name: Roave BC Check
37+
uses: docker://nyholm/roave-bc-check-ga

.github/workflows/ci.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
jobs:
10+
build-lowest-version:
11+
name: Build lowest version
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Set up PHP
16+
uses: shivammathur/[email protected]
17+
with:
18+
php-version: '7.1'
19+
coverage: xdebug
20+
extensions: mbstring
21+
22+
- name: Setup Problem Matchers for PHPUnit
23+
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
24+
25+
- name: Checkout code
26+
uses: actions/checkout@v1
27+
28+
- name: Download dependencies
29+
run: composer update --prefer-stable --prefer-dist --no-interaction --no-progress --no-suggest --prefer-lowest
30+
31+
- name: Run tests
32+
run: composer test-ci
33+
34+
build:
35+
name: Build
36+
runs-on: ubuntu-latest
37+
strategy:
38+
max-parallel: 10
39+
matrix:
40+
php: ['7.1', '7.2', '7.3', '7.4']
41+
42+
steps:
43+
- name: Set up PHP
44+
uses: shivammathur/[email protected]
45+
with:
46+
php-version: ${{ matrix.php }}
47+
extensions: mbstring
48+
49+
- name: Setup Problem Matchers for PHPUnit
50+
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
51+
52+
- name: Checkout code
53+
uses: actions/checkout@v1
54+
55+
- name: Download dependencies
56+
run: composer update --prefer-stable --prefer-dist --no-interaction --no-progress --no-suggest
57+
58+
- name: Run tests
59+
run: composer test

.github/workflows/static.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Static analysis
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
jobs:
10+
phpstan:
11+
name: PHPStan
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v1
17+
18+
- name: PHPStan
19+
uses: docker://oskarstark/phpstan-ga
20+
with:
21+
args: analyze --no-progress
22+
23+
php-cs-fixer:
24+
name: PHP-CS-Fixer
25+
runs-on: ubuntu-latest
26+
27+
steps:
28+
- name: Checkout code
29+
uses: actions/checkout@v1
30+
31+
- name: PHP-CS-Fixer
32+
uses: docker://oskarstark/php-cs-fixer-ga
33+
with:
34+
args: --dry-run --diff-format udiff

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
/behat.yml
1+
.php_cs
2+
.php_cs.cache
23
/build/
34
/composer.lock
45
/phpspec.yml
6+
/phpstan.neon
57
/phpunit.xml
68
/vendor/

.php_cs

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

.php_cs.dist

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
$config = PhpCsFixer\Config::create()
4+
->setRiskyAllowed(true)
5+
->setRules([
6+
'@Symfony' => true,
7+
'array_syntax' => ['syntax' => 'short'],
8+
'single_line_throw' => false,
9+
])
10+
->setFinder(
11+
PhpCsFixer\Finder::create()
12+
->in(__DIR__.'/src')
13+
->name('*.php')
14+
)
15+
;
16+
17+
return $config;

.scrutinizer.yml

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

.styleci.yml

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

.travis.yml

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

README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
# HTTP Message
22

33
[![Latest Version](https://img.shields.io/github/release/php-http/message.svg?style=flat-square)](https://github.com/php-http/message/releases)
4-
[![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/message.svg?style=flat-square)](https://travis-ci.org/php-http/message)
6-
[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/php-http/message.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-http/message)
7-
[![Quality Score](https://img.shields.io/scrutinizer/g/php-http/message.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-http/message)
4+
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/php-http/message/CI?style=flat-square)
85
[![Total Downloads](https://img.shields.io/packagist/dt/php-http/message.svg?style=flat-square)](https://packagist.org/packages/php-http/message)
96

107
**HTTP Message related tools.**

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"ext-zlib": "*",
2828
"akeneo/phpspec-skip-example-extension": "^1.0",
2929
"coduo/phpspec-data-provider-extension": "^1.0",
30-
"ergebnis/composer-normalize": "^2.1.1",
30+
"ergebnis/composer-normalize": "^2.1",
3131
"guzzlehttp/psr7": "^1.0",
3232
"henrikbjorn/phpspec-code-coverage": "^1.0",
3333
"phpspec/phpspec": "^2.4",

0 commit comments

Comments
 (0)