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.

0 commit comments

Comments
 (0)