From ef26cfa156c7676148f33f552b99acb5966d59bb Mon Sep 17 00:00:00 2001 From: Ben van Hartingsveldt Date: Wed, 5 Jun 2024 10:11:22 +0200 Subject: [PATCH] Switch to GitHub Actions --- .github/workflows/php.yml | 41 +++++++++++++++++++++++++++++++++++++++ .travis.yml | 10 ---------- README.md | 3 ++- phpunit.xml | 21 ++++++++++++++++++++ 4 files changed, 64 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/php.yml delete mode 100644 .travis.yml create mode 100644 phpunit.xml diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml new file mode 100644 index 0000000..af6f60f --- /dev/null +++ b/.github/workflows/php.yml @@ -0,0 +1,41 @@ +name: PHP Composer + +on: + push: + pull_request: + +permissions: + contents: read + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Validate composer.json and composer.lock + run: composer validate --strict + + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v4 + with: + path: vendor + key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-php- + + - name: Install dependencies + run: composer install --prefer-dist --no-progress + + - name: Run test suite + env: + XDEBUG_MODE: coverage + run: composer run-script test + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4.0.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 80c6d2f..0000000 --- a/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: php - -php: - - 7.3 - - 7.4 - - 8.0 - -install: composer update - -script: ./vendor/bin/phpunit . \ No newline at end of file diff --git a/README.md b/README.md index 19c6b96..610cf3b 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,8 @@ This yocLibrary enables your project to encode and decode Multibases in PHP. ## Status -[![Build Status](https://travis-ci.com/yocto/yoclib-multibase-php.svg?branch=master)](https://travis-ci.com/yocto/yoclib-multibase-php) +[![PHP Composer](https://github.com/yocto/yoclib-multibase-php/actions/workflows/php.yml/badge.svg)](https://github.com/yocto/yoclib-multibase-php/actions/workflows/php.yml) +[![codecov](https://codecov.io/gh/yocto/yoclib-multibase-php/graph/badge.svg?token=CVJJGTZJ1X)](https://codecov.io/gh/yocto/yoclib-multibase-php) ## Installation diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 0000000..7ccdf4d --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,21 @@ + + + + + + src + + + + + + tests + + + +