From 8280b590ae9d76afe603a70501c86779c5678bbd Mon Sep 17 00:00:00 2001 From: Michael Diodone Date: Mon, 13 Jun 2022 13:19:50 +0200 Subject: [PATCH] Migrate from Travis CI to GitHub actions Since Travis CI is no longer free for OS projects and GH Actions is a good replacement Also restrict PHP version to 7.3+ as the current setup won't work with older versions anyway. --- .github/workflows/tests.yml | 42 +++++++++++++++++++++++++++++++++++++ .travis.yml | 13 ------------ README.md | 2 +- composer.json | 2 +- 4 files changed, 44 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/tests.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..de58654 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,42 @@ +name: tests + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + tests: + strategy: + matrix: + php-versions: ['7.3', '7.4'] + + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v2 + with: + path: vendor + key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-php- + + - name: Install dependencies + uses: php-actions/composer@v6 + with: + version: 2 + php_version: ${{ matrix.php-versions }} + + - name: Run test suite + run: vendor/bin/phpunit diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a4f105a..0000000 --- a/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ -language: php - -php: - - '7.1' - - '7.2' - - '7.3' - - '7.4' - -script: - - vendor/bin/phpunit - -install: - - composer install diff --git a/README.md b/README.md index 38b8466..806f7e2 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ phpnsc ====== -[![Build Status](https://travis-ci.com/researchgate/phpnsc.svg?branch=master)](https://travis-ci.com/researchgate/phpnsc) +![Test status](https://github.com/researchgate/phpnsc/actions/workflows/tests.yml/badge.svg) [![Latest Stable Version](https://poser.pugx.org/rg/phpnsc/v/stable)](https://packagist.org/packages/rg/phpnsc) [![Total Downloads](https://poser.pugx.org/rg/phpnsc/downloads)](https://packagist.org/packages/rg/phpnsc) [![License](https://poser.pugx.org/rg/phpnsc/license)](https://packagist.org/packages/rg/phpnsc) diff --git a/composer.json b/composer.json index c0a78e6..8e0d743 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ } ], "require": { - "php": "^7.1", + "php": "^7.3", "symfony/console" : "^2.1|^3.0|^4.0|^5.0", "phpunit/php-timer": "^4.0|^5.0" },