Merge pull request #76 from sprout90210/feature/email-verification #48
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: Laravel Test with Docker Compose | |
on: | |
pull_request: | |
branches: | |
- develop | |
push: | |
branches: | |
- develop | |
jobs: | |
laravel-test: | |
runs-on: ubuntu-latest | |
services: | |
mysql: | |
image: mysql:8.0 | |
env: | |
MYSQL_ROOT_PASSWORD: root | |
MYSQL_DATABASE: kickoffreminder | |
MYSQL_USER: test | |
MYSQL_PASSWORD: test123 | |
ports: | |
- 3306:3306 | |
options: >- | |
--health-cmd="mysqladmin ping" | |
--health-interval=10s | |
--health-timeout=10s | |
--health-retries=3 | |
redis: | |
image: redis | |
ports: | |
- 6379:6379 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.2' | |
extensions: mbstring, pdo_mysql | |
tools: composer, phpunit | |
- name: Copy .env file | |
run: cp src/.env.example src/.env | |
- name: Install Dependencies | |
run: | | |
cd src | |
composer install --prefer-dist --no-progress --no-suggest | |
- name: Generate Key | |
run: | | |
cd src | |
php artisan key:generate | |
- name: Directory Permissions | |
run: | | |
cd src | |
chmod -R 777 storage bootstrap/cache | |
- name: Configure .env | |
run: | | |
cd src | |
echo "DB_CONNECTION=mysql" >> .env | |
echo "DB_DATABASE=kickoffreminder" >> .env | |
echo "DB_USERNAME=test" >> .env | |
echo "DB_PASSWORD=test123" >> .env | |
echo "CACHE_DRIVER=redis" >> .env | |
echo "SESSION_DRIVER=redis" >> .env | |
- name: Run Migrations | |
run: | | |
cd src | |
php artisan migrate | |
- name: Run PHPUnit Tests | |
run: | | |
cd src | |
vendor/bin/phpunit --colors=always |