Skip to content

Commit 4625c79

Browse files
authored
IBX-11328: Updated PHP versions in CI configuration with 8.3 and 8.4 (#127)
* IBX-11328: Updated PHP versions in CI configuration with 8.3 and 8.4 * PHPStan * Fixed PHPStan issues
1 parent 37e84f8 commit 4625c79

2 files changed

Lines changed: 22 additions & 27 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,14 @@ jobs:
1616
php:
1717
- '8.0'
1818
steps:
19-
- uses: actions/checkout@v2
19+
- uses: actions/checkout@v6
2020

21-
- name: Setup PHP Action
22-
uses: shivammathur/setup-php@v2
21+
- uses: ibexa/gh-workflows/actions/composer-install@main
2322
with:
24-
php-version: ${{ matrix.php }}
25-
coverage: none
26-
extensions: 'pdo_sqlite, gd'
27-
tools: cs2pr
28-
29-
- uses: "ramsey/composer-install@v1"
30-
with:
31-
dependency-versions: "highest"
23+
gh-client-id: ${{ secrets.AUTOMATION_CLIENT_ID }}
24+
gh-client-secret: ${{ secrets.AUTOMATION_CLIENT_SECRET }}
25+
satis-network-key: ${{ secrets.SATIS_NETWORK_KEY }}
26+
satis-network-token: ${{ secrets.SATIS_NETWORK_TOKEN }}
3227

3328
- name: Run code style check
3429
run: composer run-script check-cs -- --format=checkstyle | cs2pr
@@ -44,27 +39,24 @@ jobs:
4439
php:
4540
- '7.3'
4641
- '7.4'
47-
- '8.0'
48-
- '8.1'
42+
- '8.3'
43+
- '8.4'
4944

5045
steps:
51-
- uses: actions/checkout@v2
46+
- uses: actions/checkout@v6
5247

53-
- name: Setup PHP Action
54-
uses: shivammathur/setup-php@v2
48+
- uses: ibexa/gh-workflows/actions/composer-install@main
5549
with:
56-
php-version: ${{ matrix.php }}
57-
coverage: none
58-
extensions: pdo_sqlite, gd
59-
tools: cs2pr
60-
61-
- uses: "ramsey/composer-install@v1"
62-
with:
63-
dependency-versions: "highest"
64-
composer-options: "--prefer-dist --no-progress"
50+
gh-client-id: ${{ secrets.AUTOMATION_CLIENT_ID }}
51+
gh-client-secret: ${{ secrets.AUTOMATION_CLIENT_SECRET }}
52+
satis-network-key: ${{ secrets.SATIS_NETWORK_KEY }}
53+
satis-network-token: ${{ secrets.SATIS_NETWORK_TOKEN }}
6554

6655
- name: Setup problem matchers for PHPUnit
6756
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
6857

58+
- name: Run PHPStan analysis
59+
run: composer run-script phpstan
60+
6961
- name: Run test suite
7062
run: composer run-script --timeout=600 test

src/Command/LinkDependenciesCommand.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class LinkDependenciesCommand extends Command
4848
*/
4949
private $tokenProvider;
5050

51-
public function __construct(string $outputDirectory = null, ComposerLocalTokenProvider $tokenProvider = null)
51+
public function __construct(?string $outputDirectory = null, ?ComposerLocalTokenProvider $tokenProvider = null)
5252
{
5353
parent::__construct();
5454
$this->serializer = new Serializer([new ObjectNormalizer()], [new JsonEncoder()]);
@@ -170,7 +170,10 @@ private function analyzeDependencies(array $pullRequestUrls): Dependencies
170170

171171
foreach ($pullRequestUrls as $pullRequestUrl) {
172172
$matches = [];
173-
preg_match('/.*github.com\/(.*)\/(.*)\/pull\/(\d+).*/', $pullRequestUrl, $matches);
173+
if (preg_match('/.*github.com\/(.*)\/(.*)\/pull\/(\d+).*/', $pullRequestUrl, $matches) !== 1) {
174+
// Skip invalid PR URLs
175+
continue;
176+
}
174177
[, $owner, $repository, $prNumber] = $matches;
175178
$prNumber = (int)$prNumber;
176179

0 commit comments

Comments
 (0)