Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 17 additions & 25 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,14 @@ jobs:
php:
- '8.0'
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v6

- name: Setup PHP Action
uses: shivammathur/setup-php@v2
- uses: ibexa/gh-workflows/actions/composer-install@main
with:
php-version: ${{ matrix.php }}
coverage: none
extensions: 'pdo_sqlite, gd'
tools: cs2pr

- uses: "ramsey/composer-install@v1"
with:
dependency-versions: "highest"
gh-client-id: ${{ secrets.AUTOMATION_CLIENT_ID }}
gh-client-secret: ${{ secrets.AUTOMATION_CLIENT_SECRET }}
satis-network-key: ${{ secrets.SATIS_NETWORK_KEY }}
satis-network-token: ${{ secrets.SATIS_NETWORK_TOKEN }}

- name: Run code style check
run: composer run-script check-cs -- --format=checkstyle | cs2pr
Expand All @@ -44,27 +39,24 @@ jobs:
php:
- '7.3'
- '7.4'
- '8.0'
- '8.1'
- '8.3'
- '8.4'

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v6

- name: Setup PHP Action
uses: shivammathur/setup-php@v2
- uses: ibexa/gh-workflows/actions/composer-install@main
with:
php-version: ${{ matrix.php }}
coverage: none
extensions: pdo_sqlite, gd
tools: cs2pr

- uses: "ramsey/composer-install@v1"
with:
dependency-versions: "highest"
composer-options: "--prefer-dist --no-progress"
gh-client-id: ${{ secrets.AUTOMATION_CLIENT_ID }}
gh-client-secret: ${{ secrets.AUTOMATION_CLIENT_SECRET }}
satis-network-key: ${{ secrets.SATIS_NETWORK_KEY }}
satis-network-token: ${{ secrets.SATIS_NETWORK_TOKEN }}

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

- name: Run PHPStan analysis
run: composer run-script phpstan

- name: Run test suite
run: composer run-script --timeout=600 test
7 changes: 5 additions & 2 deletions src/Command/LinkDependenciesCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class LinkDependenciesCommand extends Command
*/
private $tokenProvider;

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

foreach ($pullRequestUrls as $pullRequestUrl) {
$matches = [];
preg_match('/.*github.com\/(.*)\/(.*)\/pull\/(\d+).*/', $pullRequestUrl, $matches);
if (preg_match('/.*github.com\/(.*)\/(.*)\/pull\/(\d+).*/', $pullRequestUrl, $matches) !== 1) {
// Skip invalid PR URLs
continue;
}
[, $owner, $repository, $prNumber] = $matches;
$prNumber = (int)$prNumber;

Expand Down
Loading