Skip to content

Commit

Permalink
Replace Travis-CI integration with a GitHub Workflows action
Browse files Browse the repository at this point in the history
Also updates PHP versions tested.
  • Loading branch information
rimas-kudelis committed Oct 2, 2023
1 parent 11e9f99 commit daac40c
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 12 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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
10 changes: 0 additions & 10 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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/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).

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"php": ">=7.0"
},
"require-dev": {
"phpspec/phpspec": "^5.1",
"phpspec/phpspec": "^7.4",
"squizlabs/php_codesniffer": "3.*"
},
"autoload": {
Expand Down

0 comments on commit daac40c

Please sign in to comment.