Skip to content

Instantly share code, notes, and snippets.

@smayzes
Created September 9, 2024 19:39
Show Gist options
  • Save smayzes/0b68658ee1228ba7296e200cf213403d to your computer and use it in GitHub Desktop.
Save smayzes/0b68658ee1228ba7296e200cf213403d to your computer and use it in GitHub Desktop.
phpunit.yml
name: PHPUnit
on: [pull_request]
jobs:
phpunit:
container:
image: kirschbaumdevelopment/laravel-test-runner:8.3
services:
mysql:
image: mysql:latest
env:
MYSQL_ROOT_PASSWORD: CHANGE-ME
MYSQL_DATABASE: test
MYSQL_USER: '${DB_USERNAME}'
MYSQL_PASSWORD: '${DB_PASSWORD}'
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock', '*/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Install composer dependencies
run: |
composer install --no-scripts
- name: Prepare Application
run: |
cp .env.ci .env
php artisan key:generate
- name: Run Testsuite
run: php artisan test --parallel --processes=4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment