Skip to content

Commit

Permalink
Merge pull request #9 from codebtech/chore/github-action
Browse files Browse the repository at this point in the history
Chore/GitHub action
  • Loading branch information
m0hanraj authored May 31, 2024
2 parents 4e9c9ed + d28618f commit cc65bf3
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @m0hanraj
37 changes: 37 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: PHP

on: [push, pull_request]

jobs:
lint-test:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: xdebug
coverage: xdebug
tools: composer:v2

- name: Validate composer.json and composer.lock
run: composer validate

- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Run PHPCS Lint
run: composer lint

- name: Run PHPUnit tests
run: composer test

- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage/
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
"scripts": {
"lint": "phpcs --ignore=/vendor/* --standard=PSR12 .",
"lint:fix": "phpcbf --ignore=/vendor/* --standard=PSR12 .",
"test": "phpunit --testdox --coverage-clover coverage/clover.xml --coverage-filter src/"
"test": "phpunit --testdox --coverage-clover coverage/clover.xml --coverage-html coverage --coverage-filter src/"
}
}
2 changes: 1 addition & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<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">
<testsuites>
<testsuite name="unit">
<directory suffix=".php">./Tests/</directory>
<directory suffix=".php">./tests/</directory>
</testsuite>
</testsuites>
<source>
Expand Down

0 comments on commit cc65bf3

Please sign in to comment.