diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..8c91c83 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,64 @@ +name: Build + +on: + push: + paths-ignore: + - "*.md" + pull_request: + paths-ignore: + - "*.md" + release: + types: [created] + schedule: + - + cron: "0 1 * * 6" # Run at 1am every Saturday + workflow_dispatch: ~ + +jobs: + tests: + runs-on: ubuntu-20.04 + + name: "PHP ${{ matrix.php }}" + + timeout-minutes: 50 + + strategy: + fail-fast: false + matrix: + php: ["7.4", "8.1", "8.2"] + + steps: + - + uses: actions/checkout@v3 + + - + name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: "${{ matrix.php }}" + coverage: none + + - + name: Validate composer.json + run: composer validate --ansi --strict + + - + name: Cache Composer packages + uses: actions/cache@v3 + with: + path: vendor + key: ${{ runner.os }}-php-${{ matrix.php }}-${{ hashFiles('**/composer.json **/composer.lock') }} + restore-keys: | + ${{ runner.os }}-php-${{ matrix.php }}- + + - + name: Install PHP dependencies + run: composer install --prefer-dist --no-interaction + + - + name: Check coding standard + run: vendor/bin/phpcs --colors + + - + name: Run PHPSpec + run: vendor/bin/phpspec run --ansi -f progress --no-interaction diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index e63ae94..0000000 --- a/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: php -php: - - '7.1' - - '7.2' - - '7.3' -install: - - composer install --prefer-source --no-interaction -script: - - vendor/bin/phpcs - - vendor/bin/phpspec run --format=dot diff --git a/README.md b/README.md index 806ac04..d5c1dbb 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Average percentage rate of charge calculator for PHP -[![Build status](https://api.travis-ci.org/rimas-kudelis/php-apr-calculator.svg?branch=master)](https://travis-ci.org/rimas-kudelis/php-apr-calculator) +![Build status](https://github.com/rimas-kudelis/php-apr-calculator/actions/workflows/build.yml/badge.svg) This library is an average percentage rate of charge (APR or APRC) calculator compliant* with European Commission [Directive 2014/17/EU (‘Mortgage Credit Directive’, MCD)](https://eur-lex.europa.eu/eli/dir/2014/17/oj) and European Commission [Directive 2008/48/EC (‘Consumer Credit Directive’, CCD)](https://eur-lex.europa.eu/eli/dir/2008/48/oj). diff --git a/composer.json b/composer.json index 5de2752..51cf92b 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "php": ">=7.0" }, "require-dev": { - "phpspec/phpspec": "^5.1", + "phpspec/phpspec": "^7.4", "squizlabs/php_codesniffer": "3.*" }, "autoload": {