Skip to content

Commit

Permalink
Support Laravel 8 (#126)
Browse files Browse the repository at this point in the history
* Allow Laravel 8

* add github actions script
  • Loading branch information
daryledesilva authored Feb 1, 2021
1 parent 322f181 commit 41ceff5
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 40 deletions.
86 changes: 55 additions & 31 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,57 @@
name: CI Build
name: CI
on:
push:
tags:
- v*
branches-ignore:
- master
push:
branches:
- '**'
tags-ignore:
- '**'
jobs:
quality:
name: Code Quality Checks
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v1
- name: Install Composer
uses: MilesChou/composer-action@v1.0.1
with:
args: install
- name: Run Psalm Checks
run: ./vendor/bin/psalm --output-format=compact --show-info=false

test:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v1
- name: Install Composer
uses: MilesChou/composer-action@v1.0.1
with:
args: install
- name: Run PHPUnit
run: ./vendor/bin/phpunit
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [ '7.4', '8.0' ]
laravel: [ '6.*', '7.*', '8.*' ]
prefer: [ 'prefer-lowest', 'prefer-stable' ]
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} --${{ matrix.prefer }}
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
tools: composer:v2
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"

- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ matrix.prefer }}-
restore-keys: ${{ runner.os }}-composer-${{ matrix.prefer }}-

- name: Install dependencies
run: |
composer require "illuminate/http:${{ matrix.laravel }}" "illuminate/routing:${{ matrix.laravel }}" --no-interaction --no-update
composer update --${{ matrix.prefer }} --prefer-dist --no-interaction
- name: Test with phpunit
run: ./vendor/bin/phpunit

- name: Run Psalm Checks
run: ./vendor/bin/psalm --output-format=github --show-info=false
14 changes: 5 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"description": "HATEOAS Link generation library",
"type": "library",
"require-dev": {
"vimeo/psalm": "^3.8",
"phpunit/phpunit": "^8.5"
"vimeo/psalm": "^3.8.4",
"phpunit/phpunit": "^9.3"
},
"license": "MIT",
"authors": [
Expand All @@ -25,12 +25,8 @@
}
},
"require": {
"illuminate/http": "^5.8 |^6|^7.0",
"illuminate/routing": "^5.8 |^6|^7.0"
},
"config": {
"platform": {
"php": "7.2.1"
}
"php": "^7.4|^8.0",
"illuminate/http": "^6.0|^7.0|^8.0",
"illuminate/routing": "^6.0|^7.0|^8.0"
}
}

0 comments on commit 41ceff5

Please sign in to comment.