Skip to content

Commit 5c2c47b

Browse files
Merge pull request #1 from stackkit/develop
Cleanup package
2 parents 6288c57 + 03cff2b commit 5c2c47b

File tree

8 files changed

+21
-56
lines changed

8 files changed

+21
-56
lines changed

.github/workflows/run-tests.yml

+12-35
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,18 @@ jobs:
1111

1212
strategy:
1313
matrix:
14-
db: ['mysql', 'pgsql']
1514
payload:
16-
- { queue: 'github-actions-laravel9-php81', laravel: '9.*', php: '8.1', 'testbench': '7.*'}
17-
- { queue: 'github-actions-laravel9-php80', laravel: '9.*', php: '8.0', 'testbench': '7.*'}
18-
- { queue: 'github-actions-laravel8-php81', laravel: '8.*', php: '8.1', 'testbench': '6.*'}
19-
- { queue: 'github-actions-laravel8-php80', laravel: '8.*', php: '8.0', 'testbench': '6.*'}
20-
- { queue: 'github-actions-laravel8-php74', laravel: '8.*', php: '7.4', 'testbench': '6.*'}
21-
- { queue: 'github-actions-laravel7-php80', laravel: '7.*', php: '8.0', 'testbench': '5.*' }
22-
- { queue: 'github-actions-laravel7-php74', laravel: '7.*', php: '7.4', 'testbench': '5.*' }
23-
- { queue: 'github-actions-laravel6-php80', laravel: '6.*', php: '8.0', 'testbench': '4.*' }
24-
- { queue: 'github-actions-laravel6-php74', laravel: '6.*', php: '7.4', 'testbench': '4.*' }
15+
- { laravel: '9.*', php: '8.1', 'testbench': '7.*'}
16+
- { laravel: '9.*', php: '8.0', 'testbench': '7.*'}
17+
- { laravel: '8.*', php: '8.1', 'testbench': '6.*'}
18+
- { laravel: '8.*', php: '8.0', 'testbench': '6.*'}
19+
- { laravel: '8.*', php: '7.4', 'testbench': '6.*'}
20+
- { laravel: '7.*', php: '8.0', 'testbench': '5.*' }
21+
- { laravel: '7.*', php: '7.4', 'testbench': '5.*' }
22+
- { laravel: '6.*', php: '8.0', 'testbench': '4.*' }
23+
- { laravel: '6.*', php: '7.4', 'testbench': '4.*' }
2524

26-
name: PHP ${{ matrix.payload.php }} - Laravel ${{ matrix.payload.laravel }} - DB ${{ matrix.db }}
25+
name: PHP ${{ matrix.payload.php }} - Laravel ${{ matrix.payload.laravel }}
2726

2827
steps:
2928
- name: Checkout code
@@ -36,30 +35,8 @@ jobs:
3635
extensions: mbstring, dom, fileinfo
3736
coverage: none
3837

39-
- name: Set up MySQL and PostgreSQL
40-
run: |
41-
MYSQL_PORT=3307 POSTGRES_PORT=5432 docker compose up ${{ matrix.db }} -d
42-
- name: Install dependencies
38+
- name: Execute checks
4339
run: |
4440
composer require "laravel/framework:${{ matrix.payload.laravel }}" "orchestra/testbench:${{ matrix.payload.testbench }}" --no-interaction --no-update
4541
composer update --prefer-stable --prefer-dist --no-interaction --no-suggest
46-
if [ "${{ matrix.db }}" = "mysql" ]; then
47-
while ! mysqladmin ping --host=127.0.0.1 --user=cloudtasks --port=3307 --password=cloudtasks --silent; do
48-
echo "Waiting for MySQL..."
49-
sleep 1
50-
done
51-
else
52-
echo "Not waiting for MySQL."
53-
fi
54-
- name: Execute tests
55-
env:
56-
DB_DRIVER: ${{ matrix.db }}
57-
CI_CLOUD_TASKS_PROJECT_ID: ${{ secrets.CI_CLOUD_TASKS_PROJECT_ID }}
58-
CI_CLOUD_TASKS_QUEUE: ${{ secrets.CI_CLOUD_TASKS_QUEUE }}
59-
CI_CLOUD_TASKS_LOCATION: ${{ secrets.CI_CLOUD_TASKS_LOCATION }}
60-
CI_CLOUD_TASKS_SERVICE_ACCOUNT_EMAIL: ${{ secrets.CI_CLOUD_TASKS_SERVICE_ACCOUNT_EMAIL }}
61-
CI_SERVICE_ACCOUNT_JSON_KEY: ${{ secrets.CI_SERVICE_ACCOUNT_JSON_KEY }}
62-
CI_CLOUD_TASKS_CUSTOM_QUEUE: ${{ matrix.payload.queue }}
63-
run: |
64-
echo $CI_SERVICE_ACCOUNT_JSON_KEY > tests/Support/gcloud-key-valid.json
65-
vendor/bin/phpunit
42+
vendor/bin/phpstan

assets/cloud-tasks-home.png

-1.04 MB
Binary file not shown.

assets/dashboard.png

-875 KB
Binary file not shown.

assets/logo.png

-23 KB
Loading

composer.json

+7-2
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,20 @@
1010
"require": {
1111
"google/cloud-logging": "^1.10"
1212
},
13+
"require-dev": {
14+
"phpstan/phpstan": "^1.8",
15+
"nunomaduro/larastan": "^1.0 || ^2.0",
16+
"orchestra/testbench": "^4.0 || ^5.0 || ^6.0 || ^7.0",
17+
"thecodingmachine/phpstan-safe-rule": "^1.2"
18+
},
1319
"autoload": {
1420
"psr-4": {
1521
"Stackkit\\LaravelGoogleCloudLogging\\": "src/"
1622
}
1723
},
1824
"autoload-dev": {
1925
"psr-4": {
20-
"Tests\\": "tests/",
21-
"Factories\\": "factories/"
26+
"Tests\\": "tests/"
2227
}
2328
},
2429
"extra": {

phpstan.neon

-2
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,3 @@ parameters:
66
- src
77
level: 9
88
checkMissingIterableValueType: false
9-
ignoreErrors:
10-
- '/Cannot call method when\(\) on mixed/'

phpunit.xml

-7
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010
stopOnFailure="false">
1111
<testsuites>
1212
<testsuite name="Testsuite">
13-
<file>./tests/ConfigTest.php</file>
14-
<file>./tests/TaskHandlerTest.php</file>
15-
<file>./tests/CloudTasksApiTest.php</file>
16-
<file>./tests/CloudTasksDashboardTest.php</file>
1713
</testsuite>
1814
</testsuites>
1915
<php>
@@ -23,8 +19,5 @@
2319
<env name="CACHE_DRIVER" value="array"/>
2420
<env name="SESSION_DRIVER" value="array"/>
2521
<env name="MAIL_DRIVER" value="log"/>
26-
<env name="GOOGLE_APPLICATION_CREDENTIALS" value="./tests/Support/gcloud-key-valid.json" />
27-
<env name="QUEUE_DRIVER" value="cloudtasks"/>
28-
<env name="DB_DRIVER" value="mysql" />
2922
</php>
3023
</phpunit>

tests/TestCase.php

+2-10
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,11 @@ class TestCase extends \Orchestra\Testbench\TestCase
66
{
77
protected function getPackageProviders($app)
88
{
9-
return [
10-
\Stackkit\LaravelGoogleCloudLogging\LoggingServiceProvider::class,
11-
];
12-
}
13-
14-
protected function defineDatabaseMigrations()
15-
{
16-
$this->loadMigrationsFrom(__DIR__ . '/../migrations');
17-
$this->loadMigrationsFrom(__DIR__ . '/../vendor/orchestra/testbench-core/laravel/migrations');
9+
return [];
1810
}
1911

2012
protected function getEnvironmentSetUp($app)
2113
{
22-
// $app['config']->set('cloud-tasks.dashboard.enabled', false);
14+
//
2315
}
2416
}

0 commit comments

Comments
 (0)