First question: Which version of Laravel are you using? The most recent ones need a more current version of PHP than 8.0 so I'd be double checking those requirements.
Second question: What does your .env.example file look like?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello, I'm having some trouble getting a CI pipeline setup to run my test suite through Github Actions with Laravel Jetstream and basic authentication tests. All of my other tests, like Livewire components, work without an issue.
I've using the base YAML that I've found on Github Actions for a Laravel app, but Feature tests from Laravel Jetstream and basic authentication ones (like below) fail. It seems like it has to do with $this->get() method by that is what all of these tests have in common.
My initial thought was that the web server - php artisan serve - needed to be running while the tests were running, but I tried this and it still didn't work. :(
Here's an example of a test failure:
FAILED Tests\Feature\AuthenticationTest > login screen can be rendered
Expected response status code [200] but received 500.
Failed asserting that 500 is identical to 200.
at tests/Feature/AuthenticationTest.php:18
14▕ public function test_login_screen_can_be_rendered(): void
15▕ ***
16▕ $response = $this->get('/login');
17▕
➜ 18▕ $response->assertStatus(200);
19▕ ***
20▕
21▕ public function test_users_can_authenticate_using_the_login_screen(): void
22▕ ***
Here's a copy of my current Github Actions workflow YAML file:
name: Laravel
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
laravel-tests:
runs-on: ubuntu-latest
steps:
- uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e
with:
php-version: '8.0'
- 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: Create Database
run: |
mkdir -p database
touch database/database.sqlite
- name: Execute tests (Unit and Feature tests) via PHPUnit
env:
DB_CONNECTION: sqlite
DB_DATABASE: database/database.sqlite
run: vendor/bin/phpunit
All I want to do is run my full test suite in Github Actions, so ultimately assistance with my YAML file is appreciated. Thanks for the help!
Please or to participate in this conversation.