Skip to content

Commit

Permalink
Merge pull request #13 from kblais/add-github-action
Browse files Browse the repository at this point in the history
Add GitHub action and bump PHP/Laravel minimum versions
  • Loading branch information
kblais authored Dec 8, 2020
2 parents 8a6acb1 + 02777ed commit 114bef2
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 16 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/php-cs-fixer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Check & fix styling

on: [push]

jobs:
php-cs-fixer:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}

- name: Run PHP CS Fixer
uses: docker://oskarstark/php-cs-fixer-ga
with:
args: --config=.php_cs.dist --allow-risky=yes

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Fix styling
68 changes: 68 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Tests

on: [push, pull_request]

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
php: [8.0, 7.4, 7.3, 7.2]
laravel: [8.*, 7.*, 6.*]
stability: [prefer-lowest, prefer-stable]
include:
- laravel: 8.*
testbench: 6.*
- laravel: 7.*
testbench: 5.*
- laravel: 6.*
testbench: 4.*
exclude:
- laravel: 6.*
php: 8.0
- laravel: 8.*
php: 7.2

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
coverage: none

- name: Setup problem matchers
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
- name: Execute tests
run: vendor/bin/phpunit

phpstan:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}

- name: Install dependencies
run: |
composer update --prefer-dist --no-interaction
- name: PHPStan
uses: chindit/actions-phpstan@master
File renamed without changes.
14 changes: 0 additions & 14 deletions .travis.yml

This file was deleted.

5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
"name": "kblais/laravel-helpers",
"description": "A collection of helpers for your Laravel application.",
"require": {
"illuminate/database": "^5.8|^6.0|^7.0|^8.0"
"php": "^7.2|^8.0",
"illuminate/database": "^6.0|^7.0|^8.0"
},
"require-dev": {
"orchestra/testbench": "^3.8.0|^4.0|^5.0|^6.0",
"orchestra/testbench": "^4.0|^5.0|^6.0",
"friendsofphp/php-cs-fixer": "^2.15",
"phpstan/phpstan": "^0.12"
},
Expand Down

0 comments on commit 114bef2

Please sign in to comment.