Conversation
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 file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
*) and pull requestsEnvironment Setup:
.envfile with testing defaultsphpunit.xml)Performance Optimizations:
actions/cache@v3--no-interaction --prefer-dist --optimize-autoloader)composer.lockhash-based keysTest Execution Pipeline:
php artisan key:generatetouch database/database.sqlite)php artisan migrate --forcephp artisan test(Unit and Feature tests)Expected Behavior:
This workflow follows Laravel CI/CD best practices and provides immediate feedback on code quality for all contributors.