Skip to content

Commit

Permalink
Updated workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mchev committed May 24, 2024
1 parent f72f7d2 commit fc5f1e4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 23 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,9 @@ jobs:
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "nesbot/carbon:>=2.62.1" --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-progress
- name: Publish migrations
run: |
php artisan vendor:publish --provider="Mchev\Banhammer\BanhammerServiceProvider" --tag="banhammer-migrations" --force
- name: Execute tests
run: vendor/bin/phpunit
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.idea
.phpunit.result.cache
.phpunit.cache
build
composer.lock
coverage
Expand Down
1 change: 0 additions & 1 deletion .phpunit.cache/test-results

This file was deleted.

23 changes: 1 addition & 22 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@

abstract class TestCase extends Orchestra
{

protected function setUp(): void
{
parent::setUp();
$this->publishAndRunMigrations();
}

protected function getEnvironmentSetUp($app): void
{
// Load the .env file
Expand All @@ -28,18 +21,4 @@ protected function getPackageProviders($app): array
'Mchev\Banhammer\BanhammerServiceProvider',
];
}

protected function publishAndRunMigrations(): void
{
// Publish the package migrations
$this->artisan('vendor:publish', [
'--provider' => 'Mchev\Banhammer\BanhammerServiceProvider',
'--tag' => 'banhammer-migrations',
'--force' => true,
])->run();

// Run the migrations
$this->artisan('migrate', ['--database' => 'testing'])->run();
}

}
}

0 comments on commit fc5f1e4

Please sign in to comment.