duh. It would help to actually put the actions in the right directory #11
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 Tests | |
on: | |
push: | |
branches: [master, staging, dev] | |
pull_request: | |
branches: [master, staging, dev] | |
jobs: | |
laravel-tests: | |
runs-on: ubuntu-latest | |
services: | |
mysql-test: | |
image: mysql:8.1 | |
env: | |
MYSQL_ROOT_PASSWORD: "password" | |
MYSQL_DATABASE: "ttsband" | |
MYSQL_USER: "tts" | |
MYSQL_PASSWORD: "password" | |
MYSQL_ALLOW_EMPTY_PASSWORD: "yes" | |
ports: | |
- 3306:3306 | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
steps: | |
- uses: shivammathur/setup-php@v2 | |
with: | |
php-version: "8.1" | |
- uses: actions/checkout@v3 | |
- name: Copy .env | |
run: php -r "file_exists('.env') || copy('.env.example', '.env');" | |
- name: Install Dependencies | |
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist | |
- name: Generate key | |
run: php artisan key:generate | |
- name: Directory Permissions | |
run: chmod -R 777 storage bootstrap/cache | |
- name: Execute tests via Artisan | |
env: | |
DB_CONNECTION: mysql | |
DB_HOST: 127.0.0.1 | |
run: php artisan test | |
- name: Check test status | |
if: failure() | |
run: exit 1 |