Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(testing): CI into project pipeline #7

Merged
merged 4 commits into from
Feb 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .env.ci
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# database
DB_CONNECTION=mysql
DB_HOST=mysql
DB_PORT=3306
DB_DATABASE=test
DB_USERNAME=root
DB_PASSWORD=password
34 changes: 34 additions & 0 deletions .github/workflows/laravel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
on: push
name: Laravel Test Suite w/ PHPUnit
jobs:
Testing:
runs-on: ubuntu-latest
container:
image: kirschbaumdevelopment/laravel-test-runner:8.2

services:
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: test
ports:
- 33306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1

- name: Install composer dependencies
run: |
composer install --no-scripts

- name: Prepare Laravel Application
run: |
cp .env.ci .env
php artisan key:generate

- name: Run Test Suites
run: php artisan test
4 changes: 4 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
<testsuite name="Feature">
<directory>tests/Feature</directory>
</testsuite>

<testsuite name="Jetstream">
<exclude>tests/Jetstream/*</exclude>
</testsuite>
</testsuites>
<source>
<include>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Tests\Feature;
namespace Tests\Jetstream;

use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Tests\Feature;
namespace Tests\Jetstream;

use App\Models\User;
use App\Providers\RouteServiceProvider;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Tests\Feature;
namespace Tests\Jetstream;

use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Tests\Feature;
namespace Tests\Jetstream;

use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Tests\Feature;
namespace Tests\Jetstream;

use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Tests\Feature;
namespace Tests\Jetstream;

use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Tests\Feature;
namespace Tests\Jetstream;

use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Tests\Feature;
namespace Tests\Jetstream;

use App\Models\Team;
use App\Models\User;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Tests\Feature;
namespace Tests\Jetstream;

use App\Models\User;
use App\Providers\RouteServiceProvider;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Tests\Feature;
namespace Tests\Jetstream;

// use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Tests\Feature;
namespace Tests\Jetstream;

use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Tests\Feature;
namespace Tests\Jetstream;

use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Tests\Feature;
namespace Tests\Jetstream;

use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Tests\Feature;
namespace Tests\Jetstream;

use App\Models\User;
use Illuminate\Auth\Notifications\ResetPassword;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Tests\Feature;
namespace Tests\Jetstream;

use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Tests\Feature;
namespace Tests\Jetstream;

use App\Providers\RouteServiceProvider;
use Illuminate\Foundation\Testing\RefreshDatabase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Tests\Feature;
namespace Tests\Jetstream;

use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Tests\Feature;
namespace Tests\Jetstream;

use App\Providers\RouteServiceProvider;
use Illuminate\Foundation\Testing\RefreshDatabase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Tests\Feature;
namespace Tests\Jetstream;

use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Tests\Feature;
namespace Tests\Jetstream;

use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Tests\Feature;
namespace Tests\Jetstream;

use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Tests\Feature;
namespace Tests\Jetstream;

use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
Expand Down