Skip to content

Instantly share code, notes, and snippets.

@nasrulhazim
Created April 23, 2020 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nasrulhazim/250aeae465c21fa37f0195a98efcc48f to your computer and use it in GitHub Desktop.
Save nasrulhazim/250aeae465c21fa37f0195a98efcc48f to your computer and use it in GitHub Desktop.
GitHub Action for Laravel
name: Unit Test
on:
push:
branches:
- develop
pull_request:
branches:
- develop
release:
types:
- published
jobs:
laravel-tests:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: [7.3, 7.4]
steps:
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v1
with:
path: vendor/
key: ${{ runner.os }}-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.lock') }}
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v1
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, dom, fileinfo, mysql
tools: prestissimo
- uses: actions/checkout@v2
- name: Install Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist
- name: Execute tests (Unit and Feature tests) via PHPUnit
run: vendor/bin/phpunit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment