From b7f214a212a2f9d1dcecbd6e4d5d4469ea550ce8 Mon Sep 17 00:00:00 2001 From: Akolzin Dmitry Date: Thu, 26 Nov 2020 15:57:53 +0300 Subject: [PATCH] Move CI to GitHub Actions (#13) --- .github/workflows/ci.yml | 36 ++++++++++++++++++++++++++++++++++++ .travis.yml | 19 ------------------- Makefile | 3 --- README.md | 8 ++++---- 4 files changed, 40 insertions(+), 26 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..98d57b1 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,36 @@ +name: ci + +on: + push: + branches: + - '**' + tags-ignore: + - '*.*' + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + php-version: ['7.1', '7.2', '7.3'] + steps: + - uses: actions/checkout@v2 + - name: Setup PHP ${{ matrix.php-version }} + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + tools: composer:v1 + - name: Composer cache + uses: actions/cache@v2 + with: + path: ${{ env.HOME }}/.composer/cache + key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} + - name: Install dependencies + run: composer install -o + - name: Phpstan analysis + run: make stan + - name: Run tests + run: make test + - name: Coverage + run: bash <(curl -s https://codecov.io/bash) diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c360499..0000000 --- a/.travis.yml +++ /dev/null @@ -1,19 +0,0 @@ -language: php - -cache: - directories: - - $HOME/.composer/cache - -php: - - '7.1' - - '7.2' - - '7.3' - -before_script: - - flags="-o" - - composer install $flags - -script: make travis - -after_success: - - bash <(curl -s https://codecov.io/bash) diff --git a/Makefile b/Makefile index 68e40d2..8ced0dc 100644 --- a/Makefile +++ b/Makefile @@ -13,6 +13,3 @@ stan: @echo "==> Running analysis" @php $(BIN_DIR)/phpstan analyse @echo "==> Analysis complete" - -travis: test stan - @echo "==> Completed" diff --git a/README.md b/README.md index 2f8faae..a5c01d3 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -[![Build Status](https://img.shields.io/travis/retailcrm/mg-bot-api-client-php/master.svg?style=flat-square)](https://travis-ci.org/retailcrm/mg-bot-api-client-php) -[![Covarage](https://img.shields.io/codecov/c/gh/retailcrm/mg-bot-api-client-php/master.svg?style=flat-square)](https://codecov.io/gh/retailcrm/mg-bot-api-client-php) -[![Latest stable](https://img.shields.io/packagist/v/retailcrm/mg-bot-api-client-php.svg?style=flat-square)](https://packagist.org/packages/retailcrm/mg-bot-api-client-php) -[![PHP from Packagist](https://img.shields.io/packagist/php-v/retailcrm/mg-bot-api-client-php.svg?style=flat-square)](https://packagist.org/packages/retailcrm/mg-bot-api-client-php) +[![Build Status](https://github.com/retailcrm/mg-bot-api-client-php/workflows/ci/badge.svg)](https://github.com/retailcrm/mg-bot-api-client-php/actions) +[![Covarage](https://img.shields.io/codecov/c/gh/retailcrm/mg-bot-api-client-php/master.svg?logo=codecov)](https://codecov.io/gh/retailcrm/mg-bot-api-client-php) +[![Latest stable](https://img.shields.io/packagist/v/retailcrm/mg-bot-api-client-php.svg)](https://packagist.org/packages/retailcrm/mg-bot-api-client-php) +[![PHP from Packagist](https://img.shields.io/packagist/php-v/retailcrm/mg-bot-api-client-php.svg)](https://packagist.org/packages/retailcrm/mg-bot-api-client-php) # Message Gateway Bot API PHP client