Skip to content

feat(ci): add GitHub Actions workflow for automated testing - #1

Merged
sl-cloud merged 1 commit into
mainfrom
develop
Oct 19, 2025
Merged

sl-cloud merged 1 commit into
mainfrom
develop

Conversation

@sl-cloud

Copy link
Copy Markdown
Owner

This commit introduces a comprehensive GitHub Actions CI workflow that automatically runs Laravel tests on every commit and pull request, ensuring code quality and preventing regressions.

  • Workflow Configuration:

    • Triggers on push to all branches (*) and pull requests
    • Uses Ubuntu latest with PHP 8.2 matrix strategy
    • Includes all required PHP extensions for Laravel (mbstring, xml, ctype, json, bcmath, pdo_sqlite, sqlite3, curl, zip, gd, intl, fileinfo, openssl, tokenizer)
  • Environment Setup:

    • Creates comprehensive .env file with testing defaults
    • Configures SQLite in-memory database (aligned with phpunit.xml)
    • Sets up Laravel-specific environment variables (CACHE_STORE=array, QUEUE_CONNECTION=sync, SESSION_DRIVER=array)
    • Includes AWS SQS queue URLs for testing (tests mock these anyway)
  • Performance Optimizations:

    • Caches Composer dependencies using actions/cache@v3
    • Uses optimized Composer installation flags (--no-interaction --prefer-dist --optimize-autoloader)
    • Leverages dependency caching with composer.lock hash-based keys
  • Test Execution Pipeline:

    • Generates application key with php artisan key:generate
    • Creates SQLite database file (touch database/database.sqlite)
    • Runs migrations with php artisan migrate --force
    • Executes full test suite with php artisan test (Unit and Feature tests)
  • Expected Behavior:

    • Every commit triggers automated testing
    • Results displayed in GitHub Actions tab
    • Pass/fail status indicators on commits and pull requests
    • Prevents merging of failing code

This workflow follows Laravel CI/CD best practices and provides immediate feedback on code quality for all contributors.

This commit introduces a comprehensive GitHub Actions CI workflow that automatically runs Laravel tests on every commit and pull request, ensuring code quality and preventing regressions.

- **Workflow Configuration**:
  - Triggers on push to all branches (`*`) and pull requests
  - Uses Ubuntu latest with PHP 8.2 matrix strategy
  - Includes all required PHP extensions for Laravel (mbstring, xml, ctype, json, bcmath, pdo_sqlite, sqlite3, curl, zip, gd, intl, fileinfo, openssl, tokenizer)

- **Environment Setup**:
  - Creates comprehensive `.env` file with testing defaults
  - Configures SQLite in-memory database (aligned with `phpunit.xml`)
  - Sets up Laravel-specific environment variables (CACHE_STORE=array, QUEUE_CONNECTION=sync, SESSION_DRIVER=array)
  - Includes AWS SQS queue URLs for testing (tests mock these anyway)

- **Performance Optimizations**:
  - Caches Composer dependencies using `actions/cache@v3`
  - Uses optimized Composer installation flags (`--no-interaction --prefer-dist --optimize-autoloader`)
  - Leverages dependency caching with `composer.lock` hash-based keys

- **Test Execution Pipeline**:
  - Generates application key with `php artisan key:generate`
  - Creates SQLite database file (`touch database/database.sqlite`)
  - Runs migrations with `php artisan migrate --force`
  - Executes full test suite with `php artisan test` (Unit and Feature tests)

- **Expected Behavior**:
  - Every commit triggers automated testing
  - Results displayed in GitHub Actions tab
  - Pass/fail status indicators on commits and pull requests
  - Prevents merging of failing code

This workflow follows Laravel CI/CD best practices and provides immediate feedback on code quality for all contributors.
@sl-cloud
sl-cloud merged commit 558e4be into main Oct 19, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant