Skip to content

Commit

Permalink
Merge pull request #98 from skaut/github-actions
Browse files Browse the repository at this point in the history
GitHub actions
  • Loading branch information
sinacek authored Jan 10, 2021
2 parents 801b7bb + 751098a commit 76f56ab
Show file tree
Hide file tree
Showing 9 changed files with 152 additions and 49 deletions.
132 changes: 132 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
name: main

on:
push:
branches:
- 3.x
pull_request:

jobs:
unit-tests:
runs-on: ubuntu-18.04
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
php-versions: ['7.3', '7.4', '8.0']
experimental: [ false ]
include:
- php-versions: '8.1'
experimental: true
name: Unit tests on PHP ${{ matrix.php-versions }}
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}

- name: Cache/Restore dependencies
uses: "actions/cache@v2"
with:
path: |
~/.composer/cache
vendor
key: php-${{ matrix.php-version }}
restore-keys: php-${{ matrix.php-version }}

- name: Install Dependencies
run: composer update --no-interaction --prefer-dist -a -o

- name: Run Tests
run: vendor/bin/phpunit

code-coverage:
runs-on: ubuntu-20.04
name: Collecting code-coverage
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
coverage: xdebug

- name: Cache/Restore dependencies
uses: actions/cache@v2
with:
path: |
~/.composer/cache
vendor
key: php-7.4
restore-keys: php-7.4

- name: Install Dependencies
run: composer update --no-interaction --prefer-dist -a -o

- name: Run Tests
run: vendor/bin/phpunit --coverage-clover clover.xml

- name: Upload coverage results to Coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
composer global require php-coveralls/php-coveralls
php-coveralls --coverage_clover=clover.xml -v --json_path coveralls.json
validate-syntax:
runs-on: ubuntu-20.04
name: Checking coding standard
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4

- name: Cache/Restore dependencies
uses: actions/cache@v2
with:
path: |
~/.composer/cache
vendor
key: php-7.4
restore-keys: php-7.4

- name: Install Dependencies
run: composer update --no-interaction --prefer-dist -a -o

- name: Check coding standard
run: vendor/bin/parallel-lint --no-colors --no-progress src tests

phpstan:
runs-on: ubuntu-20.04
name: Performing static analysis (PHPStan)
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4

- name: Cache/Restore dependencies
uses: actions/cache@v2
with:
path: |
~/.composer/cache
vendor
key: php-7.4
restore-keys: php-7.4

- name: Install Dependencies
run: composer update --no-interaction --prefer-dist -a -o

- name: Run PHPStan
run: vendor/bin/phpstan analyze --no-progress
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ vendor
composer.lock
composer.phar
.php_cs.cache
.phpunit.result.cache
.phpunit.result.cache
clover.xml
33 changes: 0 additions & 33 deletions .travis.yml

This file was deleted.

7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
[![Build Status](https://travis-ci.org/skaut/Skautis.svg?branch=2.x)](https://travis-ci.org/skaut/Skautis) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/skaut/Skautis/badges/quality-score.png?b=2.x)](https://scrutinizer-ci.com/g/skaut/Skautis/?branch=2.x) [![Code Coverage](https://scrutinizer-ci.com/g/skaut/Skautis/badges/coverage.png?b=2.x)](https://scrutinizer-ci.com/g/skaut/Skautis/?branch=2.x)
[![Latest Stable Version](https://poser.pugx.org/skautis/skautis/v/stable.svg)](https://packagist.org/packages/skautis/skautis) [![Latest Unstable Version](https://poser.pugx.org/skautis/skautis/v/unstable.svg)](https://packagist.org/packages/skautis/skautis) [![License](https://poser.pugx.org/skautis/skautis/license.svg)](https://packagist.org/packages/skautis/skautis)
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/skaut/Skautis/main)
[![Coverage Status](https://coveralls.io/repos/github/skaut/Skautis/badge.svg?branch=3.x)](https://coveralls.io/github/skaut/Skautis?branch=3.x)
[![Latest Stable Version](https://poser.pugx.org/skautis/skautis/v/stable.svg)](https://packagist.org/packages/skautis/skautis)
[![Latest Unstable Version](https://poser.pugx.org/skautis/skautis/v/unstable.svg)](https://packagist.org/packages/skautis/skautis)
[![License](https://poser.pugx.org/skautis/skautis/license.svg)](https://packagist.org/packages/skautis/skautis)

# SkautIS
PHP knihovna pro připojení do [Skautisu](https://is.skaut.cz/)
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@
"source": "https://github.com/skaut/Skautis"
},
"require": {
"php": ">=7.2",
"php": ">=7.3",
"ext-soap": "*",
"psr/simple-cache": "1.0.*",
"psr/event-dispatcher": "1.0.*"
},
"require-dev": {
"phpunit/phpunit": "^8.5",
"phpunit/phpunit": "^9.5",
"mockery/mockery": "^1.2",
"friendsofphp/php-cs-fixer": "^2.15",
"jakub-onderka/php-parallel-lint": "^1.0",
"php-parallel-lint/php-parallel-lint": "^1.2",
"phpstan/phpstan": "^0.12",
"symfony/cache": "^4.3"
},
Expand Down
6 changes: 3 additions & 3 deletions src/Wsdl/Event/RequestFailEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class RequestFailEvent implements Serializable
/**
* Parametry SOAP requestu na server
*
* @var array<int, mixed>
* @var array<int|string, mixed>
*/
private $args;

Expand Down Expand Up @@ -48,7 +48,7 @@ class RequestFailEvent implements Serializable

/**
* @param string $fname Nazev volane funkce
* @param array<int, mixed> $args Argumenty pozadavku
* @param array<int|string, mixed> $args Argumenty pozadavku
*/
public function __construct(
string $fname,
Expand Down Expand Up @@ -122,7 +122,7 @@ public function getFname(): string


/**
* @return array<int, mixed>
* @return array<int|string, mixed>
*/
public function getArgs(): array
{
Expand Down
6 changes: 3 additions & 3 deletions src/Wsdl/Event/RequestPostEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class RequestPostEvent implements Serializable
/**
* Parametry SOAP requestu na server
*
* @var array<int, mixed>
* @var array<int|string, mixed>
*/
private $args;

Expand All @@ -34,7 +34,7 @@ class RequestPostEvent implements Serializable

/**
* @param string $fname Nazev volane funkce
* @param array<int, mixed> $args Argumenty pozadavku
* @param array<int|string, mixed> $args Argumenty pozadavku
* @param array<int|string, mixed>|stdClass|null $result
*/
public function __construct(
Expand Down Expand Up @@ -78,7 +78,7 @@ public function getFname(): string
}

/**
* @return array<int, mixed>
* @return array<int|string, mixed>
*/
public function getArgs(): array
{
Expand Down
6 changes: 3 additions & 3 deletions src/Wsdl/Event/RequestPreEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class RequestPreEvent implements Serializable
/**
* Parametry SOAP requestu na server
*
* @var array<int, mixed>
* @var array<int|string, mixed>
*/
private $args;

Expand All @@ -38,7 +38,7 @@ class RequestPreEvent implements Serializable

/**
* @param string $fname Nazev volane funkce
* @param array<int, mixed> $args Argumenty pozadavku
* @param array<int|string, mixed> $args Argumenty pozadavku
* @param array<string, mixed> $options
* @param array<int, string> $inputHeaders
* @param array<int, array<string, mixed>> $trace Zasobnik volanych funkci
Expand Down Expand Up @@ -88,7 +88,7 @@ public function getFname(): string
}

/**
* @return array<int, mixed>
* @return array<int|string, mixed>
*/
public function getArgs(): array
{
Expand Down
2 changes: 1 addition & 1 deletion src/Wsdl/WebService.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ protected function soapCall(
* @param string $functionName Jmeno funkce volane pres SOAP
* @param array<int|string, mixed> $arguments Argumenty k mergnuti s defaultnimy
*
* @return array<int, mixed> Argumenty pro SoapClient::__soapCall
* @return array<int|string, mixed> Argumenty pro SoapClient::__soapCall
*/
protected function prepareArgs(string $functionName, array $arguments): array
{
Expand Down

0 comments on commit 76f56ab

Please sign in to comment.