From e526bc3f9d8b860a8332821f714518ac99120207 Mon Sep 17 00:00:00 2001 From: Mohan Raj Date: Fri, 31 May 2024 15:40:09 +0100 Subject: [PATCH 1/5] add github workflow --- .github/workflows/php.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/php.yml diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml new file mode 100644 index 0000000..a23e2cd --- /dev/null +++ b/.github/workflows/php.yml @@ -0,0 +1,31 @@ +name: PHP + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - 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 \ No newline at end of file From b0c9f1072a2bfebb18cfcc6cf0306314775b687e Mon Sep 17 00:00:00 2001 From: Mohan Raj Date: Fri, 31 May 2024 15:42:20 +0100 Subject: [PATCH 2/5] fix unit test dir --- phpunit.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpunit.xml b/phpunit.xml index 09b3621..3e737d4 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -2,7 +2,7 @@ - ./Tests/ + ./tests/ From 8fbdb847e3ec6a7b01ea6543e72a7b5690b9d1e4 Mon Sep 17 00:00:00 2001 From: Mohan Raj Date: Fri, 31 May 2024 15:46:43 +0100 Subject: [PATCH 3/5] add artifacts to github action --- .github/workflows/php.yml | 8 +++++++- composer.json | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index a23e2cd..5bab155 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -28,4 +28,10 @@ jobs: run: composer lint - name: Run PHPUnit tests - run: composer test \ No newline at end of file + run: composer test + + - name: Upload coverage report + uses: actions/upload-artifact@v2 + 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/" } } From edd4845281d15630360a16365d4a93c3e6b11c45 Mon Sep 17 00:00:00 2001 From: Mohan Raj Date: Fri, 31 May 2024 15:49:19 +0100 Subject: [PATCH 4/5] use v4 actions --- .github/workflows/php.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 5bab155..594da72 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -3,12 +3,12 @@ name: PHP on: [push, pull_request] jobs: - build: + lint-test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -31,7 +31,7 @@ jobs: run: composer test - name: Upload coverage report - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: coverage-report path: coverage/ \ No newline at end of file From d28618fc99be4b3a0f9b6285a16c891888942189 Mon Sep 17 00:00:00 2001 From: Mohan Raj Date: Fri, 31 May 2024 15:53:31 +0100 Subject: [PATCH 5/5] add code owner --- .github/CODEOWNERS | 1 + 1 file changed, 1 insertion(+) create mode 100644 .github/CODEOWNERS 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