Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regular update #7

Merged
merged 5 commits into from
Jan 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .codecov.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ trim_trailing_whitespace = true
[*.{md,json}]
trim_trailing_whitespace = false

[*.{yml,yaml,sh,conf}]
[*.{yml,yaml,sh,conf,*neon*}]
indent_size = 2

[Makefile]
Expand Down
15 changes: 7 additions & 8 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
* text=auto

/.github export-ignore
/tests export-ignore
/[Dd]ocker* export-ignore
/CODE_OF_CONDUCT.md export-ignore
/CONTRIBUTING.md export-ignore
/.* export-ignore
/phpunit.xml* export-ignore
/Makefile export-ignore
/.github export-ignore
/tests export-ignore
/[Dd]ocker* export-ignore
/.* export-ignore
/phpunit.xml* export-ignore
/phpstan.* export-ignore
/Makefile export-ignore
25 changes: 0 additions & 25 deletions .github/PULL_REQUEST_TEMPLATE.md

This file was deleted.

17 changes: 0 additions & 17 deletions .github/stale.yml

This file was deleted.

92 changes: 92 additions & 0 deletions .github/workflows/execute-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Execute tests

on:
push:
branches:
- master
tags-ignore:
- '**'
pull_request:

jobs: # Docs: <https://help.github.com/en/articles/workflow-syntax-for-github-actions>
tests:
name: PHP ${{ matrix.php }}, ${{ matrix.setup }} setup
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
setup: ['basic', 'lowest']
php: ['7.1', '7.2', '7.3', '7.4']
include:
- php: '7.1'
setup: 'basic'
coverage: 'true'
- php: '7.4'
setup: 'basic'
coverage: 'true'
steps:
- name: Check out code
uses: actions/checkout@v2
with:
fetch-depth: 1

- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@master # Action page: <https://github.com/shivammathur/setup-php>
with:
php-version: ${{ matrix.php }}
extensions: mbstring, pdo, pdo_sqlite, sqlite3 # definition is required for php 7.4

- name: Get Composer Cache Directory # Docs: <https://github.com/actions/cache/blob/master/examples.md#php---composer>
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies # Docs: <https://github.com/actions/cache/blob/master/examples.md#php---composer>
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install Composer 'hirak/prestissimo' package
run: composer global require hirak/prestissimo --update-no-dev

- name: Install lowest Composer dependencies
if: matrix.setup == 'lowest'
run: composer update --prefer-dist --no-interaction --no-suggest --prefer-lowest

- name: Install basic Composer dependencies
if: matrix.setup == 'basic'
run: composer update --prefer-dist --no-interaction --no-suggest

- name: Show most important packages versions
run: composer info | grep -e laravel/laravel -e phpunit/phpunit -e phpstan/phpstan

- name: Execute tests
if: matrix.coverage != 'true'
run: composer test

- name: Execute tests with code coverage
if: matrix.coverage == 'true'
run: composer test-cover

- uses: codecov/codecov-action@v1 # Docs: <https://github.com/codecov/codecov-action>
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage/clover.xml

lint-changelog:
name: Lint changelog file
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
with:
fetch-depth: 1

- name: Lint changelog file
uses: docker://avtodev/markdown-lint:v1 # Action page: <https://github.com/avto-dev/markdown-lint>
with:
rules: '/lint/rules/changelog.js'
config: '/lint/config/changelog.yml'
args: './CHANGELOG.md'
7 changes: 1 addition & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@ composer.lock
## Temp dirs & trash
/temp
/tmp
/tests/temp
/tests/tmp
/install
/build
/coverage
/phpunit.xml
clover-file
.DS_Store
.php_cs.cache
*.cache
2 changes: 2 additions & 0 deletions .styleci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ enabled:
- phpdoc_return_self_reference
- align_equals
- concat_with_spaces
- length_ordered_imports

disabled:
- unalign_equals
- concat_without_spaces
- declare_equal_normalize
- alpha_ordered_imports
16 changes: 6 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
language: php
os: linux

cache:
directories:
Expand All @@ -9,8 +10,6 @@ env:
- setup=basic
- coverage=false

sudo: false

branches:
except:
- /analysis-.*/
Expand All @@ -31,27 +30,24 @@ script:
after_success:
- if [[ $coverage = 'true' ]]; then bash <(curl -s https://codecov.io/bash); fi

matrix:
jobs:
include:
- php: 7.1.3
- php: 7.1.3
env: setup=lowest
- php: 7.1.3
env: coverage=true

- php: 7.2
- php: 7.2
env: setup=lowest
- php: 7.2
env: coverage=true

- php: 7.3
- php: 7.3
env: setup=lowest
- php: 7.3
env: coverage=true

- php: nightly

allow_failures:
- php: nightly
- php: 7.4
env: setup=lowest
- php: 7.4
env: coverage=true
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog][keepachangelog] and this project adheres to [Semantic Versioning][semver].

## v3.2.1

### Added

- Tests running using GitHub Actions
- `phpstan` configuration file with disabled `checkGenericClassInNonGenericObjectType` and `checkMissingIterableValueType`
- PHP 7.4 tests using CI

### Changed

- StyleCI rules. Enabled: `length_ordered_imports`, disabled: `alpha_ordered_imports`
- Updated dev-dependency versions
- Anonymous functions now static (where this is possible)

## v3.2.0

### Added
Expand Down
47 changes: 0 additions & 47 deletions CODE_OF_CONDUCT.md

This file was deleted.

15 changes: 0 additions & 15 deletions CONTRIBUTING.md

This file was deleted.

4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ COPY --from=composer /usr/bin/composer /usr/bin/composer
RUN set -xe \
&& apk add --no-cache binutils git curl \
&& apk add --no-cache --virtual .build-deps autoconf pkgconf make g++ gcc \
# install xdebug (for testing with code coverage), but not enable it
&& pecl install xdebug-2.7.2 \
# install xdebug (for testing with code coverage), but do not enable it
&& pecl install xdebug-2.9.1 \
&& apk del .build-deps \
&& mkdir /src ${COMPOSER_HOME} \
&& composer global require 'hirak/prestissimo' --no-interaction --no-suggest --prefer-dist \
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018 avto-dev
Copyright (c) 2020 avtocod

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
"tarampampam/wrappers-php": "^1.2"
},
"require-dev": {
"fzaninotto/faker": "^1.8",
"mockery/mockery": "^1.0",
"phpstan/phpstan": "^0.11",
"fzaninotto/faker": "^1.9.1",
"mockery/mockery": "^1.3",
"phpstan/phpstan": "^0.12.1",
"phpunit/phpunit": "^7.5",
"symfony/var-dumper": "^4.2",
"tarampampam/guzzle-url-mock": "^1.1",
Expand All @@ -48,7 +48,7 @@
"phpunit": "@php ./vendor/bin/phpunit --no-coverage --colors=always --testsuite=Unit",
"phpunit-feature": "@php ./vendor/bin/phpunit --no-coverage --colors=always --testsuite=Feature",
"phpunit-cover": "@php ./vendor/bin/phpunit --coverage-html='./coverage/html' --testsuite=Unit",
"phpstan": "@php ./vendor/bin/phpstan analyze --no-progress --ansi --level=max ./src",
"phpstan": "@php ./vendor/bin/phpstan analyze -c ./phpstan.neon.dist --no-progress --ansi",
"test": [
"@phpstan",
"@phpunit"
Expand Down
6 changes: 0 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
version: '3.2'

networks:
app-network:
driver: bridge

volumes:
composer-data:

Expand All @@ -17,5 +13,3 @@ services:
- /etc/group:/etc/group:ro
- .:/src:cached
- composer-data:/tmp/composer:cached
networks:
- app-network
13 changes: 13 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
parameters:
level: 'max'
paths:
- src
ignoreErrors:
- # Replacing with `return new self` or classes finalization requires major version upping. Make it on next major release
message: '#Unsafe usage of new static\(\)#'
paths:
- src/Responses/*Response.php
- src/Responses/Entities/*.php
- src/Exceptions/*Exception.php
checkGenericClassInNonGenericObjectType: false
checkMissingIterableValueType: false
Loading