Skip to content

Remove irrelevant code in Tests Pipeline #42

Remove irrelevant code in Tests Pipeline

Remove irrelevant code in Tests Pipeline #42

Workflow file for this run

name: Tests Pipeline
on: [push, pull_request]
env:
PHPUNIT_FLAGS: "--filter=Api --stop-on-failure"
jobs:
laravel:
name: Tests Pipeline (PHP ${{ matrix.php-versions }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-versions: ['8.2']
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP, with Composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, dom, fileinfo
coverage: none
- name: Get Composer cache directory
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache Composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composercache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install Composer dependencies
run: composer install -q --no-progress --prefer-dist --optimize-autoloader
- name: Prepare environment
run: cp .env.example .env
- name: Clear config cache
run: php artisan config:clear
- name: Generate key
run: php artisan key:generate -q -n
- name: Migrate & seed database
run: php artisan migrate --seed --force
- name: Change directory permissions
run: chmod -R 777 storage bootstrap/cache
- name: Install JavaScript packages
run: npm install --quiet --no-progress
- name: Build JavaScript packages
run: npm run build
- name: Run Laravel server
run: php artisan serve --port=3000 --no-reload &
- name: Curl to localhost
run: curl localhost:3000 &
- name: Run tests
run: php artisan test ${{ env.PHPUNIT_FLAGS }}