Skip to content

Commit

Permalink
Merge pull request #47 from botman/github-actions
Browse files Browse the repository at this point in the history
Implements GitHub actions to test every Laravel versions
  • Loading branch information
crynobone authored Sep 4, 2020
2 parents ad3586d + c6ee5e0 commit 3c42a8f
Show file tree
Hide file tree
Showing 2 changed files with 112 additions and 2 deletions.
111 changes: 111 additions & 0 deletions .github/workflows/laravel-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: 'Laravel Tests'

on:
push:
pull_request:
schedule:
- cron: '0 0 * * *'

jobs:
tests-on-php72:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [7.2]
laravel: [7.x, 6.x, 5.8, 5.7, 5.6, 5.5]

name: PHP${{ matrix.php }} with Laravel ${{ matrix.laravel }}

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

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

- 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
coverage: none

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
composer update --prefer-dist --no-interaction --no-suggest
- name: Execute tests
run: vendor/bin/phpunit


tests-on-php73:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [7.3]
laravel: [7.x, 6.x, 5.8, 5.7, 5.5]

name: PHP${{ matrix.php }} with Laravel ${{ matrix.laravel }}

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

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

- 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
coverage: none

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
composer update --prefer-dist --no-interaction --no-suggest
- name: Execute tests
run: vendor/bin/phpunit

tests-on-php74:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [7.4]
laravel: [7.x, 6.x, 5.8]

name: PHP${{ matrix.php }} with Laravel ${{ matrix.laravel }}

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

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

- 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
coverage: none

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
composer update --prefer-dist --no-interaction --no-suggest
- name: Execute tests
run: vendor/bin/phpunit
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
"thecodingmachine/discovery": "^1.2"
},
"require-dev": {
"orchestra/testbench": "^3.6|^3.7|^3.8|^4.0|^5.0",
"phpunit/phpunit": "^7.0|^8.0|^9.0",
"orchestra/testbench": "^3.5 || ^4.0 || ^5.0",
"mockery/mockery": "^1.0"
},
"autoload": {
Expand Down

0 comments on commit 3c42a8f

Please sign in to comment.