Skip to content

Commit 9123e04

Browse files
authored
Drop Laravel 9 support (#51)
* Drop Laravel 9 support * fix phpstan * update test
1 parent 15dc200 commit 9123e04

File tree

10 files changed

+42
-113
lines changed

10 files changed

+42
-113
lines changed

.github/workflows/main.yml

Lines changed: 0 additions & 79 deletions
This file was deleted.

.github/workflows/phpstan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Setup PHP
1717
uses: shivammathur/setup-php@v2
1818
with:
19-
php-version: '8.0'
19+
php-version: '8.3'
2020
coverage: none
2121

2222
- name: Install composer dependencies

.github/workflows/run-tests.yml

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,44 @@
11
name: Run Unit Tests
22

3-
on: pull_request
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
48

59
jobs:
610
build:
711
runs-on: ubuntu-latest
12+
# These permissions are needed to interact with GitHub's OIDC Token endpoint.
13+
permissions:
14+
id-token: write
15+
contents: read
816

917
strategy:
1018
fail-fast: false
1119
matrix:
12-
php: [ 8.0, 8.1, 8.2, 8.3, 8.4 ]
13-
laravel: [ 9.*, 10.*, 11.*, 12.* ]
14-
dependency-version: [ prefer-lowest, prefer-stable ]
20+
php: [8.2, 8.3, 8.4]
21+
laravel: [10.*, 11.*, 12.*]
22+
dependency-version: [prefer-lowest, prefer-stable]
1523
exclude:
16-
- laravel: 9.*
17-
php: 8.3
18-
- laravel: 9.*
19-
php: 8.4
20-
- laravel: 10.*
21-
php: 8.0
2224
- laravel: 10.*
2325
php: 8.4
24-
- laravel: 11.*
25-
php: 8.0
26-
- laravel: 11.*
27-
php: 8.1
2826
- laravel: 11.*
2927
php: 8.4
30-
- laravel: 12.*
31-
php: 8.0
32-
- laravel: 12.*
33-
php: 8.1
3428

3529
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }}
3630

3731
steps:
3832
- name: Checkout
3933
uses: actions/checkout@v4
4034

35+
- name: Configure AWS credentials
36+
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
37+
uses: aws-actions/configure-aws-credentials@v4
38+
with:
39+
role-to-assume: ${{ vars.AWS_ASSUME_ROLE }}
40+
aws-region: ${{ secrets.AWS_REGION }}
41+
4142
- name: Setup PHP
4243
uses: shivammathur/setup-php@v2
4344
with:
@@ -60,6 +61,12 @@ jobs:
6061
run: |
6162
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
6263
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
63-
64+
6465
- name: Run PHPUnit tests
65-
run: vendor/bin/phpunit --testsuite Unit
66+
if: github.event_name == 'pull_request'
67+
run: composer test:unit
68+
69+
- name: Run PHPUnit tests
70+
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
71+
run: composer test
72+

.github/workflows/update-changelog.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ on:
77
jobs:
88
update:
99
runs-on: ubuntu-latest
10+
permissions:
11+
contents: write
1012

1113
steps:
1214
- name: Checkout code

composer.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,25 +30,26 @@
3030
}
3131
],
3232
"require": {
33-
"php": "^8.0",
33+
"php": "^8.1",
3434
"aws/aws-sdk-php": "^3.209",
35-
"illuminate/support": "^9.52|^10.0|^11.0|^12.0",
35+
"illuminate/support": "^10.0|^11.0|^12.0",
3636
"spatie/enum": "^3.13"
3737
},
3838
"minimum-stability": "dev",
3939
"prefer-stable": true,
4040
"scripts": {
4141
"analyse": "vendor/bin/phpstan analyse",
42-
"test": "phpunit"
42+
"test": "phpunit",
43+
"test:unit": "phpunit --testsuite Unit"
4344
},
4445
"config": {
4546
"sort-packages": true
4647
},
4748
"require-dev": {
4849
"guzzlehttp/guzzle": "^7.4",
49-
"nunomaduro/larastan": "^1.0|^2.0|^3.0",
50-
"orchestra/testbench": "^7.0|^8.0|^9.0|^10.0",
51-
"phpunit/phpunit": "^9.5|^10.0|^11.0|^12.0",
50+
"larastan/larastan": "^2.0|^3.0",
51+
"orchestra/testbench": "^8.0|^9.0|^10.0",
52+
"phpunit/phpunit": "^10.0|^11.0|^12.0",
5253
"vlucas/phpdotenv": "^5.4"
5354
}
5455
}

phpstan.neon.dist

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
includes:
2-
- ./vendor/nunomaduro/larastan/extension.neon
2+
- ./vendor/larastan/larastan/extension.neon
33

44
parameters:
5-
65
paths:
76
- src
8-
- config
97

108
# The level 9 is the highest level
119
level: 5
1210

1311
tmpDir: build/phpstan
1412
checkModelProperties: true
15-
checkMissingIterableValueType: true

src/Builder/TimestreamPayloadBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function setMultiMeasuresValues(string $name, mixed $value, ?ValueTypeEnu
5555
$this->measureValues[] = [
5656
'Name' => $name,
5757
'Value' => $value,
58-
'Type' => $type?->value ?? ValueTypeEnum::VARCHAR()->value,
58+
'Type' => $type->value ?? ValueTypeEnum::VARCHAR()->value,
5959
];
6060

6161
return $this;

tests/Feature/PayloadWriterFeatureTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public function it_should_ingest_multi_measure_records()
4040
...$payload->toRecords(),
4141
];
4242

43+
// Write in batches of 100
4344
if (count($records) === 100) {
4445
$timestreamWriter = TimestreamWriterDto::make($records)->forTable('test');
4546

tests/Feature/ReaderFeatureTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function test_it_should_return_results()
2929

3030
public function test_it_should_return_paginated_results()
3131
{
32-
$max = 5000;
32+
$max = 300;
3333
$queryBuilder = TimestreamBuilder::query()
3434
->select('*')
3535
->from(config('timestream.database'), 'test')

tests/TestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ protected function readCSV(string $filePath): \Generator
6060
$handle = fopen($filePath, "r");
6161

6262
while (!feof($handle)) {
63-
yield fgetcsv($handle, 5000);
63+
yield fgetcsv($handle, 300);
6464
}
6565

6666
fclose($handle);

0 commit comments

Comments
 (0)