diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..8fba7ba --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,44 @@ +name: Build +on: + push: + branches: + - master + paths-ignore: + - "**/*.md" + - "LICENSE" + pull_request: +jobs: + test: + name: OpenTracing (PHP version ${{ matrix.php-versions }} on ${{ matrix.operating-system }}) + runs-on: ${{ matrix.operating-system }} + strategy: + fail-fast: false + matrix: + operating-system: [ubuntu-latest, windows-latest, macos-latest] + php-versions: ["7.1", "7.2", "7.3", "7.4", "8.0", "8.1"] + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup PHP, with composer and extensions + uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php + with: + php-version: ${{ matrix.php-versions }} + - name: Get composer cache directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - name: Cache composer dependencies + uses: actions/cache@v2 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} + restore-keys: ${{ runner.os }}-composer- + - name: Install Composer dependencies + run: | + composer install --no-progress --prefer-dist --optimize-autoloader + - name: Run lint + if: matrix.operating-system != 'windows-latest' + run: composer lint + - name: Run static check + run: composer static-check + - name: Run tests + run: composer test diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d3edeef..0000000 --- a/.travis.yml +++ /dev/null @@ -1,25 +0,0 @@ -language: php - -php: - - '7.1' - - '7.2' - - '7.3' - - '7.4' - - '8.0' - - '8.1' - -cache: - directories: - - $HOME/.composer/cache - -install: - - composer install - -before_script: - - phpenv config-add .travis/php.ini - - php -i # displays PHP config - -script: - - composer lint - - composer static-check - - composer test diff --git a/.travis/php.ini b/.travis/php.ini deleted file mode 100644 index 192d344..0000000 --- a/.travis/php.ini +++ /dev/null @@ -1,3 +0,0 @@ -display_errors = On -error_reporting = E_ALL -display_startup_errors = On diff --git a/README.md b/README.md index 13c8b27..ce03bc9 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # OpenTracing API for PHP -[![Build Status](https://travis-ci.org/opentracing/opentracing-php.svg?branch=master)](https://travis-ci.org/opentracing/opentracing-php) +[![Build](https://github.com/opentracing/opentracing-php/actions/workflows/ci.yml/badge.svg)](https://github.com/opentracing/opentracing-php/actions/workflows/ci.yml) [![OpenTracing Badge](https://img.shields.io/badge/OpenTracing-enabled-blue.svg)](http://opentracing.io) [![Total Downloads](https://poser.pugx.org/opentracing/opentracing/downloads)](https://packagist.org/packages/opentracing/opentracing) [![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%205.6-8892BF.svg)](https://php.net/)