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 repository update #11

Merged
merged 2 commits into from
Jun 29, 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
5 changes: 1 addition & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[*.{md,json}]
trim_trailing_whitespace = false

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

[Makefile]
Expand Down
3 changes: 0 additions & 3 deletions .github/CODEOWNERS

This file was deleted.

51 changes: 23 additions & 28 deletions .github/workflows/execute-tests.yml → .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Execute tests
name: tests

on:
push:
Expand All @@ -7,82 +7,77 @@ on:
tags-ignore:
- '**'
pull_request:
schedule:
- cron: '0 0 * * 0' # once in a week, docs: <https://git.io/JvxXE#onschedule>

jobs: # Docs: <https://help.github.com/en/articles/workflow-syntax-for-github-actions>
tests:
jobs: # Docs: <https://git.io/JvxXE>
php:
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'
setup: [basic, lowest]
coverage: [yes]
php: ['7.2', '7.3', '7.4']
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>
uses: shivammathur/setup-php@v2 # 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
extensions: mbstring

- name: Get Composer Cache Directory # Docs: <https://github.com/actions/cache/blob/master/examples.md#php---composer>
- name: Get Composer Cache Directory # Docs: <https://git.io/JfAKn#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
- name: Cache dependencies # Docs: <https://git.io/JfAKn#php---composer>
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
key: ${{ runner.os }}-composer-${{ matrix.setup }}-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

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

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

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

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

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

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

- uses: codecov/codecov-action@v1 # Docs: <https://github.com/codecov/codecov-action>
if: matrix.coverage == 'yes'
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage/clover.xml
flags: php
fail_ci_if_error: false

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>
Expand Down
53 changes: 0 additions & 53 deletions .travis.yml

This file was deleted.

7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ 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].

## UNRELEASED

### Changed

- CI completely moved from "Travis CI" to "Github Actions" _(travis builds disabled)_
- Minimal required PHP version now is `7.2`

## v3.3.1

### Fixed
Expand Down
16 changes: 6 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
FROM composer:1.8.6 AS composer

FROM php:7.1.3-alpine
FROM php:7.2.5-alpine

ENV \
COMPOSER_ALLOW_SUPERUSER="1" \
COMPOSER_HOME="/tmp/composer"

COPY --from=composer /usr/bin/composer /usr/bin/composer
COPY --from=composer:1.10.7 /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 \
RUN set -x \
&& apk add --no-cache binutils git \
&& apk add --no-cache --virtual .build-deps autoconf pkgconf make g++ gcc 1>/dev/null \
# install xdebug (for testing with code coverage), but do not enable it
&& pecl install xdebug-2.9.1 \
&& pecl install xdebug-2.9.1 1>/dev/null \
&& apk del .build-deps \
&& mkdir /src ${COMPOSER_HOME} \
&& composer global require 'hirak/prestissimo' --no-interaction --no-suggest --prefer-dist \
Expand All @@ -23,5 +21,3 @@ RUN set -xe \
&& php -m

WORKDIR /src

VOLUME ["/src"]
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# PHP client for B2B API service

[![Version][badge_packagist_version]][link_packagist]
[![Version][badge_php_version]][link_packagist]
[![PHP Version][badge_php_version]][link_packagist]
[![Build Status][badge_build_status]][link_build_status]
[![Coverage][badge_coverage]][link_coverage]
[![Downloads count][badge_downloads_count]][link_packagist]
Expand All @@ -16,7 +16,7 @@
Require this package with composer using the following command:

```shell
$ composer require avtocod/b2b-api-php "^3.2"
$ composer require avtocod/b2b-api-php "^3.3"
```

> Installed `composer` is required ([how to install composer][getcomposer]).
Expand All @@ -30,7 +30,7 @@ Before using this package you must have:
- Service user login
- User password
- User domain name
- And report type name
- Report type name

> For getting this values contact with our B2B Sale Managers (`b2b@avtocod.ru`)

Expand Down Expand Up @@ -95,7 +95,7 @@ while (true) {
if ($client->userReport($report_uid, false)->first()->isCompleted()) {
break;
}

\sleep(1);
}

Expand Down Expand Up @@ -135,7 +135,7 @@ This is open-sourced software licensed under the [MIT License][link_license].

[badge_packagist_version]:https://img.shields.io/packagist/v/avtocod/b2b-api-php.svg?maxAge=180
[badge_php_version]:https://img.shields.io/packagist/php-v/avtocod/b2b-api-php.svg?longCache=true
[badge_build_status]:https://travis-ci.org/avtocod/b2b-api-php.svg?branch=master
[badge_build_status]:https://img.shields.io/github/workflow/status/avtocod/b2b-api-php/tests/master
[badge_coverage]:https://img.shields.io/codecov/c/github/avtocod/b2b-api-php/master.svg?maxAge=60
[badge_downloads_count]:https://img.shields.io/packagist/dt/avtocod/b2b-api-php.svg?maxAge=180
[badge_license]:https://img.shields.io/packagist/l/avtocod/b2b-api-php.svg?longCache=true
Expand Down
15 changes: 5 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,29 @@
}
],
"require": {
"php": "^7.1.3",
"php": "^7.2",
"ext-curl": "*",
"ext-json": "*",
"guzzlehttp/guzzle": "^6.0",
"ocramius/package-versions": "^1.2",
"tarampampam/wrappers-php": "^1.2"
"tarampampam/wrappers-php": "^1.5"
},
"require-dev": {
"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",
"vlucas/phpdotenv": "^3.4"
},
"autoload": {
"psr-4": {
"Avtocod\\B2BApi\\": "src"
"Avtocod\\B2BApi\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Avtocod\\B2BApi\\Tests\\": "tests"
"Avtocod\\B2BApi\\Tests\\": "tests/"
}
},
"suggest": {
Expand All @@ -61,9 +60,5 @@
"support": {
"issues": "https://github.com/avtocod/b2b-api-php/issues",
"source": "https://github.com/avtocod/b2b-api-php"
},
"config": {
"sort-packages": true
},
"prefer-stable": true
}
}
2 changes: 1 addition & 1 deletion tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php

ini_set('error_reporting', E_ALL);
ini_set('error_reporting', (string) \E_ALL);
ini_set('display_errors', '1');
ini_set('display_startup_errors', '1');