Skip to content

Commit

Permalink
Use Github actions (#356)
Browse files Browse the repository at this point in the history
* [TASK] Use .php_cs directly. No use for .php_cs.dist file

* [TASK] Use phpunit.xml directly

* [FEATURE] Add github actions instead of travis integration
  • Loading branch information
sabbelasichon committed Mar 2, 2020
1 parent 2080c88 commit 0c4672b
Show file tree
Hide file tree
Showing 11 changed files with 111 additions and 167 deletions.
3 changes: 0 additions & 3 deletions .coveralls.yml

This file was deleted.

7 changes: 0 additions & 7 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,8 @@ charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.php]
indent_style = space
indent_size = 4

[*.rst]
indent_style = space
indent_size = 3

[*.yml]
indent_style = space
indent_size = 2
27 changes: 27 additions & 0 deletions .github/workflows/code_coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Code Coverage

on:
pull_request: null
push:
branches:
- master

jobs:
code_coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.0.0
- uses: shivammathur/setup-php@v1
with:
php-version: 7.3
coverage: none

- run: composer install --no-progress

- run: |
phpdbg -qrr -d memory_limit=-1 vendor/bin/phpunit --coverage-clover build/logs/clover.xml
# Coveralls.io
wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.1.0/php-coveralls.phar
php php-coveralls.phar --verbose
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
28 changes: 28 additions & 0 deletions .github/workflows/php_cs_fixer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Format (PHP)

on:
push:
branches:
- "master"

jobs:
php-cs-fixer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.0.0
- uses: shivammathur/setup-php@v1
with:
php-version: 7.2
coverage: none

- run: composer install --no-progress

- name: Run php-cs-fixer
run: ./vendor/bin/php-cs-fixer fix --config=./.php_cs

- uses: stefanzweifel/git-auto-commit-action@v2.5.0
with:
commit_message: Apply php-cs-fixer changes
branch: "master"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24 changes: 24 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Tests

on:
pull_request: null
push:
branches:
- master

jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
php: ['7.2', '7.3', '7.4']

name: PHP ${{ matrix.php }} tests
steps:
- uses: actions/checkout@v2.0.0
- uses: shivammathur/setup-php@v1
with:
php-version: ${{ matrix.php }}
coverage: none # disable xdebug, pcov
- run: composer install --no-progress
- run: vendor/bin/phpunit
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
.idea/
vendor/
phpunit.xml
.php_cs.cache
.php_cs
# The Api reference is auto generated and should not be part of the repository
/Documentation-GENERATED-temp
sphpdox.phar
Expand Down
1 change: 0 additions & 1 deletion .php_cs.dist → .php_cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ $finder = PhpCsFixer\Finder::create()
->exclude('.github')
->exclude('Configuration')
->exclude('Documentation')
->exclude('Migrations')
->exclude('Resources')
->exclude('vendor')
->in(__DIR__);
Expand Down
45 changes: 0 additions & 45 deletions .styleci.yml

This file was deleted.

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

This file was deleted.

32 changes: 32 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit
backupGlobals="true"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertWarningsToExceptions="true"
forceCoversAnnotation="false"
processIsolation="false"
stopOnError="false"
stopOnFailure="false"
stopOnIncomplete="false"
stopOnSkipped="false"
verbose="false"
beStrictAboutTestsThatDoNotTestAnything="false"
failOnRisky="true"
failOnWarning="true"
>
<testsuites>
<testsuite name="Surf Test Suite">
<directory>./tests/</directory>
</testsuite>
</testsuites>

<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./src</directory>
</whitelist>
</filter>
</phpunit>
32 changes: 0 additions & 32 deletions phpunit.xml.dist

This file was deleted.

0 comments on commit 0c4672b

Please sign in to comment.