Skip to content

Commit

Permalink
Adds automated test using build matrix (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
abbasali authored Nov 26, 2020
1 parent e1f1067 commit f23a5c3
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: tests

on:
push:
pull_request:

jobs:
tests:

runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php: [7.2, 7.4]
laravel: [^6.0, ^7.0, ^8.0]
exclude:
# Exclude laravel 8 on php 7.2 as it requires php 7.3+
- php: 7.2
laravel: ^8.0

name: Run Test (P${{ matrix.php }} - L${{ matrix.laravel }})

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

- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, fileinfo
tools: composer:v2
coverage: none

- name: Install dependencies
run: |
composer require "illuminate/database=${{ matrix.laravel }}" --no-update
composer update --prefer-dist --no-interaction --no-progress
- name: Execute tests
run: vendor/bin/phpunit --verbose

- name: Upload artifacts (on failure)
uses: actions/upload-artifact@master
if: failure()
with:
name: Logs
path: ./storage/logs

0 comments on commit f23a5c3

Please sign in to comment.