Skip to content

Commit

Permalink
fix test suite workflow #108
Browse files Browse the repository at this point in the history
  • Loading branch information
beesaferoot committed Dec 15, 2024
1 parent e77431a commit 3231f7f
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions .github/workflows/test_suite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,23 @@ on:
branches: [main]

jobs:
laravel-tests:
tests:
runs-on: ubuntu-latest

# Test on multiple PHP versions
strategy:
matrix:
php-version: ["8.2"]

services:
mariadb:
image: mariadb:10.11
env:
MYSQL_DATABASE: micro_power_manager
MYSQL_ROOT_PASSWORD: wF9zLp2qRxaS2e
ports:
- 3306:3306

steps:
# Checkout code
- uses: actions/checkout@v3
Expand All @@ -35,31 +44,22 @@ jobs:
- name: Install Composer Dependencies
run: |
composer install --no-interaction --prefer-dist
composer dump-autoload
working-directory: ./src/backend

# # Generate application key
# Generate application key
# - name: Generate key
# run: php artisan key:generate
# working-directory: ./src/backend

# Run database migrations for testing
- name: Run Migrations
run: |
php artisan migrate --env=.env
php artisan migrate-tenant --env=.env
env:
DB_CONNECTION: sqlite
DB_DATABASE: database/database.sqlite
working-directory: ./src/backend
# - name: Run Migrations
# run: |
# php artisan migrate --env=.env
# php artisan migrate-tenant --env=.env

# Run PHPUnit tests with coverage
- name: Execute tests (Unit and Feature tests) via PHPUnit
env:
DB_CONNECTION: sqlite
DB_DATABASE: database/database.sqlite
run: |
mkdir -p database
touch database/database.sqlite
php artisan test --coverage
run: php artisan test
continue-on-error: true
working-directory: ./src/backend

0 comments on commit 3231f7f

Please sign in to comment.