Use Psr\Http\Client\ClientInterface as type (#33) #51
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Continuous Integration" | |
on: | |
- pull_request | |
- push | |
jobs: | |
coding-standards: | |
name: "Coding Standards" | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@master | |
- name: "Install PHP 7.4" | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: "7.4" | |
extensions: mbstring, xml | |
tools: composer:v1 | |
- name: "Cache dependencies" | |
uses: actions/cache@v1 | |
id: cache | |
with: | |
path: ~/.composer/cache/files | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-composer- | |
- name: "Validate composer.json" | |
run: php $(which composer) validate --strict | |
- name: "Install dependencies with composer" | |
run: php $(which composer) install --no-interaction --no-progress | |
- name: "Run PHP CodeSniffer" | |
run: php vendor/bin/phpcs --standard=phpcs.xml | |
static-code-analysis: | |
name: "Static Code Analysis" | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@master | |
- name: "Install PHP 7.4" | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: "7.4" | |
extensions: mbstring, xml | |
tools: composer:v1 | |
- name: "Cache dependencies" | |
uses: actions/cache@v1 | |
id: cache | |
with: | |
path: ~/.composer/cache/files | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-composer- | |
- name: "Install dependencies with composer" | |
run: php $(which composer) install --no-interaction --no-progress --no-plugins | |
- name: "Run phpstan/phpstan" | |
run: php vendor/bin/phpstan analyse --level 8 src tests | |
tests: | |
name: "Tests" | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php-version: | |
- "7.2" | |
- "7.3" | |
- "7.4" | |
dependencies: | |
- lowest | |
- highest | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@master | |
- name: "Install PHP ${{ matrix.php-version }}" | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-version }} | |
extensions: mbstring, xml | |
coverage: xdebug | |
tools: composer:v1 | |
- name: "Cache dependencies" | |
uses: actions/cache@v1 | |
id: cache | |
with: | |
path: ~/.composer/cache/files | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-composer- | |
- name: "Install lowest dependencies with composer" | |
if: matrix.dependencies == 'lowest' | |
run: php $(which composer) update --no-interaction --no-progress --no-plugins --prefer-lowest | |
- name: "Install highest dependencies with composer" | |
if: matrix.dependencies == 'highest' | |
run: php $(which composer) update --no-interaction --no-progress --no-plugins | |
- name: "Run unit tests" | |
run: php vendor/bin/phpunit | |
code-coverage: | |
name: "Code Coverage" | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@master | |
- name: "Install PHP 7.4" | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: "7.4" | |
extensions: mbstring, xml | |
coverage: xdebug:v2 | |
tools: composer:v1 | |
- name: "Cache dependencies" | |
uses: actions/cache@v1 | |
id: cache | |
with: | |
path: ~/.composer/cache/files | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-composer- | |
- name: "Install dependencies with composer" | |
run: composer install --no-interaction --no-progress --no-plugins | |
- name: "Collect code coverage with Xdebug and phpunit/phpunit" | |
run: vendor/bin/phpunit --coverage-clover=build/logs/clover.xml | |
- name: "Download code coverage uploader for Codecov.io" | |
run: curl -s https://codecov.io/bash -o codecov | |
- name: "Send code coverage report to Codecov.io" | |
run: bash codecov -t ${{ secrets.CODECOV_TOKEN }} |