Skip to content

Commit

Permalink
Merge pull request #122 from php-http/github-actions
Browse files Browse the repository at this point in the history
Add GitHub actions
  • Loading branch information
sagikazarmark committed Jan 3, 2020
2 parents 74924cb + 209c486 commit 2c1307e
Show file tree
Hide file tree
Showing 37 changed files with 537 additions and 166 deletions.
27 changes: 12 additions & 15 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
.editorconfig export-ignore
.gitattributes export-ignore
/.github/ export-ignore
.gitignore export-ignore
/.php_cs export-ignore
/.scrutinizer.yml export-ignore
/.styleci.yml export-ignore
/.travis.yml export-ignore
/behat.yml.dist export-ignore
/features/ export-ignore
/phpspec.ci.yml export-ignore
/phpspec.yml.dist export-ignore
/phpunit.xml.dist export-ignore
/spec/ export-ignore
/tests/ export-ignore
.editorconfig export-ignore
.gitattributes export-ignore
/.github/ export-ignore
.gitignore export-ignore
/.php_cs.dist export-ignore
/phpspec.ci.yml export-ignore
/phpspec.yml.dist export-ignore
/phpstan-baseline.neon export-ignore
/phpstan.neon.dist export-ignore
/phpunit.xml.dist export-ignore
/spec/ export-ignore
/tests/ export-ignore
2 changes: 2 additions & 0 deletions .github/workflows/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[*.yml]
indent_size = 2
37 changes: 37 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Checks

on:
push:
branches:
- master
pull_request:

jobs:
composer-normalize:
name: Composer Normalize
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v1

- name: Install
uses: docker://composer
with:
args: install

- name: Normalize
uses: docker://composer
with:
args: composer normalize --dry-run

roave-bc-check:
name: Roave BC Check
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v1

- name: Roave BC Check
uses: docker://nyholm/roave-bc-check-ga
59 changes: 59 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: CI

on:
push:
branches:
- master
pull_request:

jobs:
build-lowest-version:
name: Build lowest version
runs-on: ubuntu-latest

steps:
- name: Set up PHP
uses: shivammathur/setup-php@1.6.2
with:
php-version: '7.1'
coverage: xdebug
extensions: mbstring

- name: Setup Problem Matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Checkout code
uses: actions/checkout@v1

- name: Download dependencies
run: composer update --prefer-stable --prefer-dist --no-interaction --no-progress --no-suggest --prefer-lowest

- name: Run tests
run: composer test-ci

build:
name: Build
runs-on: ubuntu-latest
strategy:
max-parallel: 10
matrix:
php: ['7.1', '7.2', '7.3', '7.4']

steps:
- name: Set up PHP
uses: shivammathur/setup-php@1.6.2
with:
php-version: ${{ matrix.php }}
extensions: mbstring

- name: Setup Problem Matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Checkout code
uses: actions/checkout@v1

- name: Download dependencies
run: composer update --prefer-stable --prefer-dist --no-interaction --no-progress --no-suggest

- name: Run tests
run: composer test
34 changes: 34 additions & 0 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Static analysis

on:
push:
branches:
- master
pull_request:

jobs:
phpstan:
name: PHPStan
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v1

- name: PHPStan
uses: docker://oskarstark/phpstan-ga
with:
args: analyze --no-progress

php-cs-fixer:
name: PHP-CS-Fixer
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v1

- name: PHP-CS-Fixer
uses: docker://oskarstark/php-cs-fixer-ga
with:
args: --dry-run --diff-format udiff
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/behat.yml
.php_cs
.php_cs.cache
/build/
/composer.lock
/phpspec.yml
/phpstan.neon
/phpunit.xml
/vendor/
13 changes: 0 additions & 13 deletions .php_cs

This file was deleted.

17 changes: 17 additions & 0 deletions .php_cs.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

$config = PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setRules([
'@Symfony' => true,
'array_syntax' => ['syntax' => 'short'],
'single_line_throw' => false,
])
->setFinder(
PhpCsFixer\Finder::create()
->in(__DIR__.'/src')
->name('*.php')
)
;

return $config;
8 changes: 0 additions & 8 deletions .scrutinizer.yml

This file was deleted.

14 changes: 0 additions & 14 deletions .styleci.yml

This file was deleted.

36 changes: 0 additions & 36 deletions .travis.yml

This file was deleted.

5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
# HTTP Message

[![Latest Version](https://img.shields.io/github/release/php-http/message.svg?style=flat-square)](https://github.com/php-http/message/releases)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)
[![Build Status](https://img.shields.io/travis/php-http/message.svg?style=flat-square)](https://travis-ci.org/php-http/message)
[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/php-http/message.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-http/message)
[![Quality Score](https://img.shields.io/scrutinizer/g/php-http/message.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-http/message)
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/php-http/message/CI?style=flat-square)
[![Total Downloads](https://img.shields.io/packagist/dt/php-http/message.svg?style=flat-square)](https://packagist.org/packages/php-http/message)

**HTTP Message related tools.**
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"ext-zlib": "*",
"akeneo/phpspec-skip-example-extension": "^1.0",
"coduo/phpspec-data-provider-extension": "^1.0",
"ergebnis/composer-normalize": "^2.1.1",
"ergebnis/composer-normalize": "^2.1",
"guzzlehttp/psr7": "^1.0",
"henrikbjorn/phpspec-code-coverage": "^1.0",
"phpspec/phpspec": "^2.4",
Expand Down

0 comments on commit 2c1307e

Please sign in to comment.