Skip to content
This repository has been archived by the owner on Apr 28, 2024. It is now read-only.

Commit

Permalink
Added Github Action CI
Browse files Browse the repository at this point in the history
  • Loading branch information
lcharette committed Dec 11, 2020
1 parent 4fee792 commit 56fe806
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Build

on:
push:
branches: [master, develop]
pull_request:
branches: [master, develop]

jobs:
PHPUnit:

strategy:
fail-fast: false
matrix:
php_versions: ['7.1', '7.2', '7.3', '7.4']
laravel: ['5.8.*']

name: PHPUnit Tests - ${{ matrix.php_versions }} - ${{ matrix.laravel }}
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php_versions }}
extensions: mbstring, dom, fileinfo, gd
coverage: xdebug
tools: pecl
- name: Set Laravel version
run: composer require "illuminate/redis:${{ matrix.laravel }}" --no-update
- name: Install Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Execute tests (Unit and Feature tests) via PHPUnit & MySQL Env
if: ${{ matrix.database == 'mysql' }}
env:
DB_CONNECTION: mysql
DB_HOST: 127.0.0.1
DB_USER: laravel
DB_PASSWORD: password
DB_DATABASE: laravel
DB_PORT: 3306
run: vendor/bin/phpunit
- name: Execute tests via PHPUnit
run: vendor/bin/phpunit
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
file: ./_meta/coverage.xml
fail_ci_if_error: true
4 changes: 4 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,8 @@
<directory suffix=".php">src/</directory>
</whitelist>
</filter>
<logging>
<log type="coverage-html" target="_meta/coverage"/>
<log type="coverage-clover" target="_meta/coverage.xml"/>
</logging>
</phpunit>

0 comments on commit 56fe806

Please sign in to comment.