Created
April 23, 2020 13:59
-
-
Save nasrulhazim/250aeae465c21fa37f0195a98efcc48f to your computer and use it in GitHub Desktop.
GitHub Action for Laravel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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