diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..f92a3c8 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @m0hanraj \ No newline at end of file diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml new file mode 100644 index 0000000..594da72 --- /dev/null +++ b/.github/workflows/php.yml @@ -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/ \ No newline at end of file diff --git a/composer.json b/composer.json index e8eebfa..76868f8 100644 --- a/composer.json +++ b/composer.json @@ -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/" } } diff --git a/phpunit.xml b/phpunit.xml index 09b3621..3e737d4 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -2,7 +2,7 @@ - ./Tests/ + ./tests/