Skip to content

Commit 716c2cd

Browse files
authored
Merge pull request #11 from dotkernel/update-workflow-files
Update workflow files
2 parents d43e931 + 9df6849 commit 716c2cd

22 files changed

+229
-249
lines changed

.github/workflows/codecov.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
on:
2+
- push
3+
4+
name: Run Codecov checks
5+
6+
jobs:
7+
code-coverage:
8+
name: Code Coverage
9+
10+
runs-on: ${{ matrix.os }}
11+
12+
strategy:
13+
matrix:
14+
os:
15+
- ubuntu-latest
16+
17+
php:
18+
- "8.2"
19+
- "8.3"
20+
- "8.4"
21+
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
26+
- name: Install PHP
27+
uses: shivammathur/setup-php@v2
28+
with:
29+
php-version: "${{ matrix.php }}"
30+
coverage: pcov
31+
ini-values: assert.exception=1, zend.assertions=1, error_reporting=-1, log_errors_max_len=0, display_errors=On
32+
tools: composer:v2, cs2pr
33+
34+
- name: Determine composer cache directory
35+
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
36+
37+
- name: Cache dependencies installed with composer
38+
uses: actions/cache@v4
39+
with:
40+
path: ${{ env.COMPOSER_CACHE_DIR }}
41+
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
42+
restore-keys: |
43+
php${{ matrix.php }}-composer-
44+
45+
- name: Install dependencies with composer
46+
env:
47+
COMPOSER_DEV_MODE: 1
48+
run: composer install --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
49+
50+
- name: Collect code coverage with PHPUnit
51+
run: vendor/bin/phpunit --colors=always --coverage-clover clover.xml
52+
53+
- name: Send code coverage report to Codecov.io
54+
uses: codecov/codecov-action@v3
55+
with:
56+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/continuous-integration.yml

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,8 @@ on:
44
pull_request:
55
push:
66
branches:
7-
- '[0-9]+.[0-9]+.x'
8-
- 'refs/pull/*'
97
tags:
108

119
jobs:
12-
matrix:
13-
name: Generate job matrix
14-
runs-on: ubuntu-latest
15-
outputs:
16-
matrix: ${{ steps.matrix.outputs.matrix }}
17-
steps:
18-
- name: Gather CI configuration
19-
id: matrix
20-
uses: laminas/laminas-ci-matrix-action@v1
21-
22-
qa:
23-
name: QA Checks
24-
needs: [matrix]
25-
runs-on: ${{ matrix.operatingSystem }}
26-
strategy:
27-
fail-fast: false
28-
matrix: ${{ fromJSON(needs.matrix.outputs.matrix) }}
29-
steps:
30-
- name: ${{ matrix.name }}
31-
uses: laminas/laminas-continuous-integration-action@v1
32-
with:
33-
job: ${{ matrix.job }}
10+
ci:
11+
uses: laminas/workflow-continuous-integration/.github/workflows/[email protected]

.github/workflows/create-project.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Qodana
2+
on:
3+
workflow_dispatch:
4+
pull_request:
5+
push:
6+
branches:
7+
- 'main'
8+
9+
jobs:
10+
qodana:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
pull-requests: write
15+
checks: write
16+
strategy:
17+
matrix:
18+
php-versions: [ '8.2', '8.3', '8.4']
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
ref: ${{ github.event.pull_request.head.sha }} # to check out the actual pull request commit, not the merge commit
23+
fetch-depth: 0 # a full history is required for pull request analysis
24+
- name: Install PHP
25+
uses: shivammathur/setup-php@v2
26+
with:
27+
php-version: ${{ matrix.php-versions }}
28+
coverage: pcov
29+
ini-values: assert.exception=1, zend.assertions=1, error_reporting=-1, log_errors_max_len=0, display_errors=On
30+
tools: composer:v2, cs2pr
31+
32+
- name: Determine composer cache directory
33+
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
34+
35+
- name: Cache dependencies installed with composer
36+
uses: actions/cache@v4
37+
with:
38+
path: ${{ env.COMPOSER_CACHE_DIR }}
39+
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
40+
restore-keys: |
41+
php${{ matrix.php }}-composer-
42+
43+
- name: Install dependencies with composer
44+
run: composer install --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
45+
- name: 'Qodana Scan'
46+
uses: JetBrains/[email protected]
47+
env:
48+
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}

.github/workflows/release-on-milestone-closed.yml

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

composer.json

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
"symfony/redis-messenger": "^v7.2.3"
5454
},
5555
"require-dev": {
56+
"laminas/laminas-coding-standard": "^3.0",
5657
"phpunit/phpunit": "^10.5.45",
5758
"psalm/plugin-phpunit": "^0.19.2",
5859
"roave/security-advisories": "dev-master",
@@ -66,39 +67,18 @@
6667
},
6768
"autoload-dev": {
6869
"psr-4": {
70+
"DotTest\\Mail\\": "test/"
6971
}
7072
},
7173
"scripts": {
72-
"development-disable": "laminas-development-mode disable",
73-
"development-enable": "laminas-development-mode enable",
74-
"development-status": "laminas-development-mode status",
75-
"mezzio": "laminas --ansi",
7674
"check": [
7775
"@cs-check",
7876
"@test"
7977
],
80-
"clear-config-cache": "php bin/clear-config-cache.php",
81-
"enable-codestandard": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin::run",
82-
"cs-check": [
83-
"@enable-codestandard",
84-
"phpcs -s"
85-
],
86-
"cs-fix": [
87-
"@enable-codestandard",
88-
"phpcbf"
89-
],
90-
"serve": [
91-
"Composer\\Config::disableProcessTimeout",
92-
"php -S 0.0.0.0:8080 -t public/"
93-
],
94-
"static-analysis": "psalm --stats",
95-
"static-analysis-update-baseline": "psalm --stats --update-baseline",
78+
"cs-check": "phpcs",
79+
"cs-fix": "phpcbf",
9680
"test": "phpunit --colors=always",
97-
"test-coverage": "phpunit --colors=always --coverage-clover clover.xml"
98-
},
99-
"scripts-descriptions": {
100-
"clear-config-cache": "Clears merged config cache. Required for config changes to be applied.",
101-
"static-analysis": "Run static analysis tool Psalm.",
102-
"static-analysis-update-baseline": "Run static analysis tool Psalm and update baseline."
81+
"test-coverage": "phpunit --colors=always --coverage-clover clover.xml",
82+
"static-analysis": "psalm --shepherd --stats"
10383
}
10484
}

config/autoload/cli.global.php

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
use Dot\Cli\FileLockerInterface;
6+
use Queue\Swoole\Command\StartCommand;
7+
use Queue\Swoole\Command\StopCommand;
8+
use Symfony\Component\Messenger\Command\ConsumeMessagesCommand;
9+
use Symfony\Component\Messenger\Command\DebugCommand;
410

511
return [
612
'dot_cli' => [
713
'version' => '1.0.0',
814
'name' => 'DotKernel CLI',
915
'commands' => [
10-
"swoole:start" => \Queue\Swoole\Command\StartCommand::class,
11-
"swoole:stop" => \Queue\Swoole\Command\StopCommand::class,
12-
"messenger:start" => \Symfony\Component\Messenger\Command\ConsumeMessagesCommand::class,
13-
"messenger:debug" => \Symfony\Component\Messenger\Command\DebugCommand::class
16+
"swoole:start" => StartCommand::class,
17+
"swoole:stop" => StopCommand::class,
18+
"messenger:start" => ConsumeMessagesCommand::class,
19+
"messenger:debug" => DebugCommand::class,
1420
],
1521
],
1622
FileLockerInterface::class => [
1723
'enabled' => false,
1824
'dirPath' => getcwd() . '/data/lock',
1925
],
20-
];
26+
];

config/pipeline.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
// - $app->pipe('/docs', $apiDocMiddleware);
3535
// - $app->pipe('/files', $filesMiddleware);
3636

37-
3837
// The following handle routing failures for common conditions:
3938
// - HEAD request but no routes answer that method
4039
// - OPTIONS request but no routes answer that method
@@ -53,9 +52,7 @@
5352

5453
// Register the dispatch middleware in the middleware pipeline
5554

56-
5755
// At this point, if no Response is returned by any middleware, the
5856
// NotFoundHandler kicks in; alternately, you can provide other fallback
5957
// middleware to execute.
60-
6158
};

0 commit comments

Comments
 (0)