Skip to content

Commit

Permalink
Add github actions
Browse files Browse the repository at this point in the history
- Now the laravel discounts support laravel 5.8 or above
  • Loading branch information
ErickZH committed Oct 15, 2020
1 parent 128cf04 commit 18c480d
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 42 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: tests

on: [push, pull_request]

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
php: [7.4, 7.3, 7.2]
laravel: [8.*, 7.*, 6.*, 5.8.*]
dependency-version: [prefer-stable]
os: [ubuntu-latest]
include:
- laravel: 8.*
testbench: 6.*
- laravel: 7.*
testbench: 5.*
- laravel: 6.*
testbench: 4.*
- laravel: 5.8.*
testbench: 3.8.*

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

services:
mysql:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: laravel-discounts
ports:
- 3306

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

- name: Cache dependencies
uses: actions/cache@v1
with:
path: ~/.composer/cache/files
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}

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

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
- name: Execute tests
run: vendor/bin/phpunit
env:
DB_PORT: ${{ job.services.mysql.ports[3306] }}
38 changes: 0 additions & 38 deletions .travis.yml

This file was deleted.

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ $item = Item::find(1);
$item->createDiscount(100);

```
## Requirements
The Laravel Discounts package requires PHP >= 7.2 and Laravel >= 5.8.

## Installation

Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
}
],
"require": {
"php": "^7.1",
"illuminate/database": "~5.6.0|~5.7.0|~5.8.0|^6.0|^7.0|^8.0",
"illuminate/support": "~5.5.0|~5.6.0|~5.7.0|~5.8.0|^6.0|^7.0|^8.0"
"php": "^7.2",
"illuminate/database": "~5.8.0|^6.0|^7.0|^8.0",
"illuminate/support": "~5.8.0|^6.0|^7.0|^8.0"
},
"require-dev": {
"phpunit/phpunit": "^7.0|^8.0|^9.0",
"orchestra/testbench": "~3.6.0|~3.7.0|~3.8.0|^4.0|^5.0|^6.0"
"orchestra/testbench": "~3.8.0|^4.0|^5.0|^6.0"
},
"autoload": {
"psr-4": {
Expand Down

0 comments on commit 18c480d

Please sign in to comment.