Skip to content

Commit cc65bf3

Browse files
authored
Merge pull request #9 from codebtech/chore/github-action
Chore/GitHub action
2 parents 4e9c9ed + d28618f commit cc65bf3

File tree

4 files changed

+40
-2
lines changed

4 files changed

+40
-2
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @m0hanraj

.github/workflows/php.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: PHP
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
lint-test:
7+
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v4
12+
13+
- name: Setup PHP
14+
uses: shivammathur/setup-php@v2
15+
with:
16+
php-version: '8.2'
17+
extensions: xdebug
18+
coverage: xdebug
19+
tools: composer:v2
20+
21+
- name: Validate composer.json and composer.lock
22+
run: composer validate
23+
24+
- name: Install dependencies
25+
run: composer install --prefer-dist --no-progress
26+
27+
- name: Run PHPCS Lint
28+
run: composer lint
29+
30+
- name: Run PHPUnit tests
31+
run: composer test
32+
33+
- name: Upload coverage report
34+
uses: actions/upload-artifact@v4
35+
with:
36+
name: coverage-report
37+
path: coverage/

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@
3030
"scripts": {
3131
"lint": "phpcs --ignore=/vendor/* --standard=PSR12 .",
3232
"lint:fix": "phpcbf --ignore=/vendor/* --standard=PSR12 .",
33-
"test": "phpunit --testdox --coverage-clover coverage/clover.xml --coverage-filter src/"
33+
"test": "phpunit --testdox --coverage-clover coverage/clover.xml --coverage-html coverage --coverage-filter src/"
3434
}
3535
}

phpunit.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.1/phpunit.xsd" bootstrap="vendor/autoload.php" colors="true" columns="max" cacheDirectory=".phpunit.cache">
33
<testsuites>
44
<testsuite name="unit">
5-
<directory suffix=".php">./Tests/</directory>
5+
<directory suffix=".php">./tests/</directory>
66
</testsuite>
77
</testsuites>
88
<source>

0 commit comments

Comments
 (0)