-
Notifications
You must be signed in to change notification settings - Fork 210
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from imliam/master
Add GitHub Actions & Fix Tests
- Loading branch information
Showing
4 changed files
with
99 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Run Tests | ||
on: [push] | ||
|
||
jobs: | ||
run: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
max-parallel: 15 | ||
fail-fast: false | ||
matrix: | ||
php-versions: ['7.2', '7.3', '7.4'] | ||
laravel-versions: ['^7.0'] | ||
name: Test on PHP ${{ matrix.php-versions }}, Laravel ${{ matrix.laravel-versions }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@master | ||
- name: Install PHP | ||
uses: shivammathur/setup-php@master | ||
with: | ||
php-version: ${{ matrix.php-versions }} | ||
- name: Create Laravel app | ||
run: | | ||
composer create-project laravel/laravel=${{ matrix.laravel-versions }} ../app --prefer-dist | ||
- name: Install Packages | ||
run: | | ||
mkdir -p ../app | ||
cd ../app | ||
composer require livewire/livewire | ||
composer config repositories.local '{"type": "path", "url": "../tall"}' --file composer.json | ||
composer require laravel-frontend-presets/tall dev-master | ||
php artisan ui tall --auth | ||
- name: Run PHPUnit | ||
run: | | ||
cd ../app | ||
php vendor/bin/phpunit |
This file contains 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
32 changes: 32 additions & 0 deletions
32
stubs/auth/database/migrations/2014_10_12_100000_create_password_resets_table.php
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
class CreatePasswordResetsTable extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::create('password_resets', function (Blueprint $table) { | ||
$table->string('email')->index(); | ||
$table->string('token'); | ||
$table->timestamp('created_at')->nullable(); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::dropIfExists('password_resets'); | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
namespace Tests; | ||
|
||
use Illuminate\Foundation\Mix; | ||
use Illuminate\Foundation\Testing\TestCase as BaseTestCase; | ||
|
||
abstract class TestCase extends BaseTestCase | ||
{ | ||
use CreatesApplication; | ||
|
||
protected function setUp(): void | ||
{ | ||
parent::setUp(); | ||
|
||
// Swap out the Mix manifest implementation, so we don't need | ||
// to run the npm commands to generate a manifest file for | ||
// the assets in order to run tests that return views. | ||
$this->swap(Mix::class, function () { | ||
return ''; | ||
}); | ||
} | ||
} |