Skip to content

Commit

Permalink
Added github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
edson-nascimento committed Jul 12, 2022
1 parent 4e99780 commit d0df535
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 5 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Run tests
on:
push:
branches:
- feature/drop-support-php56
pull_request:
types:
- opened
- reopened
- ready_for_review
workflow_dispatch:
jobs:
run-tests:
if: ${{ !github.event.pull_request.draft }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Add HTTP basic auth credentials
run: echo '${{ secrets.COMPOSER_AUTH_JSON }}' > $GITHUB_WORKSPACE/auth.json

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: "7.4"
extensions: mbstring
tools: composer:v2, phpunit:9.5

#TODO test with env github actios
- name: Add config/env.test.php
run: echo '${{ secrets.ENV_PHP }}' > $GITHUB_WORKSPACE/config/env.test.php

- name: Install dependencies
run: composer update --no-interaction --no-progress --ignore-platform-reqs

- name: Static analysis
run: composer phpstan

- name: PHPUnit tests
run: composer phpunit

- name: Remove temp files
run: rm -f $GITHUB_WORKSPACE/auth.json, $GITHUB_WORKSPACE/config/env.test.php
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@
},
"scripts":{
"phpstan":"phpstan analyse -c phpstan.neon",
"phpunit":"phpunit --configuration phpunit.xml --testdox",
"test":[
"@phpstan",
"phpunit --configuration phpunit.xml --testdox"
"@phpunit"
],
"test:unit":"phpunit --configuration phpunit.xml --testdox --exclude e2e",
"test:e2e":"phpunit --configuration phpunit.xml --testdox --group e2e",
Expand Down
7 changes: 4 additions & 3 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
parameters:
level: 5
paths:
- /
excludePaths:
- vendor
- src
- tests
- config
- examples
ignoreErrors:
2 changes: 1 addition & 1 deletion src/Getnet/API/TraitEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ trait TraitEntity

/**
*
* @return array
* @return mixed
*/
public function jsonSerialize()
{
Expand Down

0 comments on commit d0df535

Please sign in to comment.