Skip to content

Commit 12d1e26

Browse files
committed
switch to github actions
1 parent 47e68ca commit 12d1e26

14 files changed

+271
-83
lines changed

.github/CONTRIBUTING.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Contributing
2+
3+
Please see our [contributing guide](http://docs.php-http.org/en/latest/development/contributing.html).

.github/ISSUE_TEMPLATE.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
| Q | A
2+
| ------------ | ---
3+
| Bug? | no|yes
4+
| New Feature? | no|yes
5+
| Version | Specific version or SHA of a commit
6+
7+
8+
#### Actual Behavior
9+
10+
What is the actual behavior?
11+
12+
13+
#### Expected Behavior
14+
15+
What is the behavior you expect?
16+
17+
18+
#### Steps to Reproduce
19+
20+
What are the steps to reproduce this bug? Please add code examples,
21+
screenshots or links to GitHub repositories that reproduce the problem.
22+
23+
24+
#### Possible Solutions
25+
26+
If you have already ideas how to solve the issue, add them here.
27+
(remove this section if not needed)

.github/PULL_REQUEST_TEMPLATE.md

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
| Q | A
2+
| --------------- | ---
3+
| Bug fix? | no|yes
4+
| New feature? | no|yes
5+
| BC breaks? | no|yes
6+
| Deprecations? | no|yes
7+
| Related tickets | fixes #X, partially #Y, mentioned in #Z
8+
| Documentation | if this is a new feature, link to pull request in https://github.com/php-http/documentation that adds relevant documentation
9+
| License | MIT
10+
11+
12+
#### What's in this PR?
13+
14+
Explain what the changes in this PR do.
15+
16+
17+
#### Why?
18+
19+
Which problem does the PR fix? (remove this section if you linked an issue above)
20+
21+
22+
#### Example Usage
23+
24+
``` php
25+
// If you added new features, show examples of how to use them here
26+
// (remove this section if not a new feature)
27+
28+
$foo = new Foo();
29+
30+
// Now we can do
31+
$foo->doSomething();
32+
```
33+
34+
35+
#### Checklist
36+
37+
- [ ] Updated CHANGELOG.md to describe BC breaks / deprecations | new feature | bugfix
38+
- [ ] Documentation pull request created (if not simply a bugfix)
39+
40+
41+
#### To Do
42+
43+
- [ ] If the PR is not complete but you want to discuss the approach, list what remains to be done here

.github/workflows/.editorconfig

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[*.yml]
2+
indent_size = 2

.github/workflows/checks.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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@v2
17+
18+
- name: Composer normalize
19+
uses: docker://ergebnis/composer-normalize-action
20+
21+
roave-bc-check:
22+
name: Roave BC Check
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- name: Checkout code
27+
uses: actions/checkout@v2
28+
29+
- name: Roave BC Check
30+
uses: docker://nyholm/roave-bc-check-ga

.github/workflows/ci.yml

+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
jobs:
10+
supported-versions-matrix:
11+
name: Supported Versions Matrix
12+
runs-on: ubuntu-latest
13+
outputs:
14+
version: ${{ steps.supported-versions-matrix.outputs.version }}
15+
steps:
16+
- uses: actions/checkout@v3
17+
- id: supported-versions-matrix
18+
uses: WyriHaximus/github-action-composer-php-versions-in-range@v1
19+
latest:
20+
name: PHP ${{ matrix.php }} Latest
21+
runs-on: ubuntu-latest
22+
needs:
23+
- supported-versions-matrix
24+
strategy:
25+
matrix:
26+
php: ${{ fromJson(needs.supported-versions-matrix.outputs.version) }}
27+
28+
steps:
29+
- name: Checkout code
30+
uses: actions/checkout@v2
31+
32+
- name: Setup PHP
33+
uses: shivammathur/setup-php@v2
34+
with:
35+
php-version: ${{ matrix.php }}
36+
tools: composer
37+
coverage: none
38+
39+
- name: Install dependencies
40+
run: composer update --prefer-dist --no-interaction --no-progress
41+
42+
- name: boot test server
43+
run: vendor/bin/http_test_server > /dev/null 2>&1 &
44+
45+
- name: Execute tests
46+
run: composer test
47+
48+
lowest:
49+
name: PHP ${{ matrix.php }} Lowest
50+
runs-on: ubuntu-latest
51+
needs:
52+
- supported-versions-matrix
53+
strategy:
54+
matrix:
55+
php: ${{ fromJson(needs.supported-versions-matrix.outputs.version) }}
56+
57+
steps:
58+
- name: Checkout code
59+
uses: actions/checkout@v2
60+
61+
- name: Setup PHP
62+
uses: shivammathur/setup-php@v2
63+
with:
64+
php-version: ${{ matrix.php }}
65+
tools: composer
66+
coverage: none
67+
68+
- name: Install dependencies
69+
run: composer update --prefer-dist --prefer-stable --prefer-lowest --no-interaction --no-progress
70+
71+
- name: boot test server
72+
run: vendor/bin/http_test_server > /dev/null 2>&1 &
73+
74+
- name: Execute tests
75+
run: composer test
76+
77+
coverage:
78+
name: Code Coverage
79+
runs-on: ubuntu-latest
80+
81+
steps:
82+
- name: Checkout code
83+
uses: actions/checkout@v2
84+
85+
- name: Setup PHP
86+
uses: shivammathur/setup-php@v2
87+
with:
88+
php-version: 7.4
89+
tools: composer
90+
coverage: xdebug
91+
92+
- name: Install dependencies
93+
run: composer update --prefer-dist --no-interaction --no-progress
94+
95+
- name: generate ssl
96+
run: cd ./tests/server/ssl && ./generate.sh && pwd && ls -la && cd ../../../
97+
98+
- name: Execute tests
99+
run: composer test-ci

.github/workflows/static.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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@v2
17+
18+
- name: PHPStan
19+
uses: docker://oskarstark/phpstan-ga
20+
env:
21+
REQUIRE_DEV: true
22+
with:
23+
args: analyze --no-progress
24+
25+
php-cs-fixer:
26+
name: PHP-CS-Fixer
27+
runs-on: ubuntu-latest
28+
29+
steps:
30+
- name: Checkout code
31+
uses: actions/checkout@v2
32+
33+
- name: PHP-CS-Fixer
34+
uses: docker://oskarstark/php-cs-fixer-ga
35+
with:
36+
args: --dry-run --diff

.gitignore

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
.puli/
2-
build/
3-
vendor/
4-
composer.lock
5-
phpspec.yml
6-
phpunit.xml
7-
/.php_cs.cache
1+
/.php-cs-fixer.cache
2+
/.puli/
3+
/build/
4+
/composer.lock
5+
/phpstan.neon
6+
/phpunit.xml
87
/tests/server/ssl/*.pem
98
/tests/server/ssl/*.key
109
/tests/server/ssl/*.req
10+
/vendor/

.php-cs-fixer.dist.php

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
$finder = PhpCsFixer\Finder::create()
4+
->exclude('vendor')
5+
->in(__DIR__)
6+
;
7+
8+
$config = (new PhpCsFixer\Config())
9+
->setRiskyAllowed(true)
10+
->setRules([
11+
'@Symfony' => true,
12+
])
13+
->setFinder($finder)
14+
;
15+
16+
return $config;

.php_cs

-22
This file was deleted.

.scrutinizer.yml

-8
This file was deleted.

.travis.yml

-45
This file was deleted.

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
}
1010
],
1111
"require": {
12-
"php": ">=7.1 ",
12+
"php": "^7.1 | ^8.0",
1313
"nyholm/psr7": "^1.3",
1414
"php-http/httplug": "^2.0",
1515
"psr/http-client": "^1.0",

phpstan.neon.dist

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
parameters:
2+
level: max
3+
paths:
4+
- src
5+
ignoreErrors:
6+
- message: '#^Method Http\\Adapter\\React\\Client::sendRequest\(\) should return Psr\\Http\\Message\\ResponseInterface but returns mixed.$#'
7+
path: src/Client.php

0 commit comments

Comments
 (0)