Skip to content

Commit fc5c30c

Browse files
author
Sean O'Brien
committed
chore: add 8.5 to workflows
1 parent 079d193 commit fc5c30c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+402
-279
lines changed
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: PHP Composer Windows
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
run:
14+
runs-on: windows-latest
15+
strategy:
16+
matrix:
17+
include:
18+
- php-versions: '8.1'
19+
composer-options: ''
20+
- php-versions: '8.2'
21+
composer-options: ''
22+
- php-versions: '8.3'
23+
composer-options: ''
24+
- php-versions: '8.4'
25+
composer-options: ''
26+
- php-versions: '8.5'
27+
composer-options: ''
28+
name: PHP ${{ matrix.php-versions }} ${{ matrix.composer-options }}
29+
env:
30+
AWS_ACCESS_KEY_ID: foo
31+
AWS_SECRET_ACCESS_KEY: bar
32+
AWS_CSM_ENABLED: false
33+
AWS_SUPPRESS_PHP_DEPRECATION_WARNING: true
34+
steps:
35+
- name: Setup PHP with Xdebug
36+
uses: shivammathur/setup-php@v2
37+
with:
38+
coverage: xdebug
39+
php-version: ${{ matrix.php-versions }}
40+
ini-values: xdebug.overload_var_dump=0, memory_limit=4G, phar.readonly=false
41+
extensions: sockets
42+
43+
- name: Checkout codebase
44+
uses: actions/checkout@v5
45+
with:
46+
fetch-depth: 0
47+
48+
- name: Validate composer.json and composer.lock
49+
run: composer validate
50+
51+
- name: Install dependencies
52+
run: composer update ${{ matrix.composer-options }} --no-interaction --prefer-source
53+
54+
- name: Run test suite
55+
run: make test
56+
57+
- name: Static analysis
58+
run: |
59+
composer require --dev nette/neon "^3.4.4" phpstan/phpstan "2.1.1" --ignore-platform-req=php --update-with-all-dependencies
60+
vendor\bin\phpstan analyse src
61+
62+
- if: ${{ matrix.composer-options == '' }}
63+
name: Package generation
64+
run: |
65+
composer config platform.php 8.1
66+
composer update
67+
php -d phar.readonly=0 build/packager.php
68+
69+
- if: ${{ matrix.composer-options == '' }}
70+
name: Code Coverage
71+
run: |
72+
curl -o codecov.exe https://uploader.codecov.io/latest/windows/codecov.exe
73+
.\codecov.exe

.github/workflows/tests.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ jobs:
5050
composer-options: '--prefer-lowest'
5151
- php-versions: '8.4'
5252
composer-options: ''
53+
- php-versions: '8.4'
54+
composer-options: '--prefer-lowest'
55+
- php-versions: '8.5'
56+
composer-options: ''
5357
# set the name for each job
5458
name: PHP ${{ matrix.php-versions }} ${{ matrix.composer-options }}
5559
# set up environment variables used by unit tests
@@ -92,8 +96,7 @@ jobs:
9296
# static analysis
9397
- name: Static analysis
9498
run: |
95-
composer require --dev nette/neon "^3.4.4"
96-
composer require --dev phpstan/phpstan "2.1.1"
99+
composer require --dev nette/neon "^3.4.4" phpstan/phpstan "2.1.1" --ignore-platform-req=php --update-with-all-dependencies
97100
vendor/bin/phpstan analyse src
98101
99102
# generate package

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@
2525
"ext-json": "*",
2626
"ext-simplexml": "*",
2727
"aws/aws-crt-php": "^1.2.3",
28-
"psr/http-message": "^2.0"
28+
"psr/http-message": "^2.0",
29+
"symfony/filesystem": "^v6.4.3 || ^v7.1.0"
2930
},
3031
"require-dev": {
3132
"composer/composer" : "^2.7.8",
3233
"ext-openssl": "*",
3334
"ext-dom": "*",
34-
"ext-pcntl": "*",
3535
"ext-sockets": "*",
3636
"phpunit/phpunit": "^5.6.3 || ^8.5 || ^9.5",
3737
"behat/behat": "~3.0",
@@ -41,14 +41,14 @@
4141
"psr/cache": "^2.0 || ^3.0",
4242
"psr/simple-cache": "^2.0 || ^3.0",
4343
"sebastian/comparator": "^1.2.3 || ^4.0 || ^5.0",
44-
"symfony/filesystem": "^v6.4.0 || ^v7.1.0",
4544
"yoast/phpunit-polyfills": "^2.0",
4645
"dms/phpunit-arraysubset-asserts": "^0.4.0"
4746
},
4847
"suggest": {
4948
"ext-openssl": "Allows working with CloudFront private distributions and verifying received SNS messages",
5049
"ext-curl": "To send requests using cURL",
5150
"ext-sockets": "To use client-side monitoring",
51+
"ext-pcntl": "*",
5252
"doctrine/cache": "To use the DoctrineCacheAdapter",
5353
"aws/aws-php-sns-message-validator": "To validate incoming SNS notifications"
5454
},

src/UserAgentMiddleware.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,11 @@ private function getOsName(): string
172172
if (function_exists('php_uname')
173173
&& !in_array('php_uname', $disabledFunctions, true)
174174
) {
175-
$osName = "OS/" . php_uname('s') . '#' . php_uname('r');
175+
// Replace spaces with underscores to prevent breaking the user agent format
176+
$os = str_replace(' ', '_', php_uname('s'));
177+
$release = php_uname('r');
178+
$osName = "OS/{$os}#{$release}";
179+
176180
if (!empty($osName)) {
177181
return $osName;
178182
}

tests/AbstractConfigurationProviderTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ public function testGetsHomeDirectoryForWindowsUsers()
2929
putenv('HOMEPATH=\\My\\Home');
3030
$ref = new \ReflectionClass('\Aws\AbstractConfigurationProvider');
3131
$meth = $ref->getMethod('getHomeDir');
32-
$meth->setAccessible(true);
3332
$this->assertSame('C:\\My\\Home', $meth->invoke(null));
3433
}
3534

@@ -79,7 +78,6 @@ public function testsPersistsToCache()
7978
// Set interfaceClass property that's normally set by child class
8079
$ref = new \ReflectionClass('\Aws\AbstractConfigurationProvider');
8180
$property = $ref->getProperty('interfaceClass');
82-
$property->setAccessible(true);
8381
$property->setValue(null,'\Aws\ResultInterface');
8482

8583
$timesCalled = 0;

tests/Api/Parser/EventParsingIteratorTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ public function testParsedEventsMatchExpectedType($iterator)
122122
{
123123
$reflectedIteratorClass = new \ReflectionClass(get_class($iterator));
124124
$shapeProperty = $reflectedIteratorClass->getProperty('shape');
125-
$shapeProperty->setAccessible(true);
126125
$shape = $shapeProperty->getValue($iterator);
127126
foreach ($iterator as $event) {
128127
$this->parsedEventMatchesExpectedType($shape, $event);

tests/Api/ShapeTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,13 @@ public function testValidatesShapeAt()
3232
$this->expectException(\InvalidArgumentException::class);
3333
$s = new Shape([], new ShapeMap([]));
3434
$m = new \ReflectionMethod($s, 'shapeAt');
35-
$m->setAccessible(true);
3635
$m->invoke($s, 'not_there');
3736
}
3837

3938
public function testReturnsShapesFor()
4039
{
4140
$s = new Shape(['foo' => ['type' => 'string']], new ShapeMap([]));
4241
$m = new \ReflectionMethod($s, 'shapeAt');
43-
$m->setAccessible(true);
4442
$this->assertInstanceOf(Shape::class, $m->invoke($s, 'foo'));
4543
}
4644

@@ -51,7 +49,6 @@ public function testReturnsNestedShapeReferences()
5149
new ShapeMap(['bar' => ['type' => 'string']])
5250
);
5351
$m = new \ReflectionMethod($s, 'shapeAt');
54-
$m->setAccessible(true);
5552
$result = $m->invoke($s, 'foo');
5653
$this->assertInstanceOf(Shape::class, $result);
5754
$this->assertSame('string', $result->getType());
@@ -76,7 +73,6 @@ public function testValidatesShapeTypes()
7673
new ShapeMap([])
7774
);
7875
$m = new \ReflectionMethod($s, 'shapeAt');
79-
$m->setAccessible(true);
8076
$m->invoke($s, 'foo');
8177
}
8278

tests/Auth/AuthSchemeResolverTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ public function testIsCompatibleAuthSchemeReturnsTrueForValidScheme()
136136
$resolver = new AuthSchemeResolver($credentialProvider);
137137
$reflection = new \ReflectionClass($resolver);
138138
$method = $reflection->getMethod('isCompatibleAuthScheme');
139-
$method->setAccessible(true);
140139
$this->assertTrue($method->invokeArgs($resolver, ['v4']));
141140
}
142141

@@ -150,7 +149,6 @@ public function testIsCompatibleAuthSchemeReturnsFalseForInvalidScheme()
150149
$resolver = new AuthSchemeResolver($credentialProvider);
151150
$reflection = new \ReflectionClass($resolver);
152151
$method = $reflection->getMethod('isCompatibleAuthScheme');
153-
$method->setAccessible(true);
154152
$this->assertFalse($method->invokeArgs($resolver, ['invalidScheme']));
155153
}
156154

tests/AwsClientTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,6 @@ public function testCanGetSignatureProvider()
302302
{
303303
$client = $this->createClient([]);
304304
$ref = new \ReflectionMethod($client, 'getSignatureProvider');
305-
$ref->setAccessible(true);
306305
$provider = $ref->invoke($client);
307306
$this->assertIsCallable($provider);
308307
}
@@ -472,9 +471,7 @@ public function testLoadsAliases()
472471
]);
473472
$ref = new \ReflectionClass(AwsClient::class);
474473
$method = $ref->getMethod('loadAliases');
475-
$method->setAccessible(true);
476474
$property = $ref->getProperty('aliases');
477-
$property->setAccessible(true);
478475
$method->invokeArgs(
479476
$client,
480477
[__DIR__ . '/fixtures/aws_client_test/aliases.json']
@@ -497,7 +494,6 @@ public function testCallsAliasedFunction()
497494
]);
498495
$ref = new \ReflectionClass(AwsClient::class);
499496
$method = $ref->getMethod('loadAliases');
500-
$method->setAccessible(true);
501497
$method->invokeArgs(
502498
$client,
503499
[__DIR__ . '/fixtures/aws_client_test/aliases.json']

tests/Build/Docs/CodeSnippetGeneratorTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ public function testCanBuildCodeExamples(
2525
$expected,
2626
$isInput = true
2727
) {
28+
if (PHP_OS_FAMILY === 'Windows') {
29+
$this->markTestSkipped();
30+
}
31+
2832
$builder = new CodeSnippetGenerator($service);
2933
$this->assertSame($expected, $builder($operation, $input, [], $isInput));
3034
}

0 commit comments

Comments
 (0)