duh. It would help to actually put the actions in the right directory #25
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: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "22.7.0" | |
- name: Install specific npm version | |
run: npm install -g npm@10.8.2 | |
- name: Install Dependencies | |
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist | |
- name: Install NPM dependencies | |
run: npm ci | |
- name: Build assets | |
run: npm run build | |
- 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 |