From 955bc60eb3896a6cf4c006361f9d05755998dde7 Mon Sep 17 00:00:00 2001 From: naingaunglwin-dev Date: Tue, 9 Dec 2025 14:58:58 +0630 Subject: [PATCH 1/2] chore: add test workflow for master and dev branches --- .github/workflows/tests.yml | 41 +++++++++++++++++++++++++++++++++++++ composer.json | 3 +++ 2 files changed, 44 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..24e1791 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,41 @@ +name: Tests + +on: + push: + branches: [ "master", "dev" ] + pull_request: + branches: [ "master", "dev" ] + +permissions: + contents: read + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 8.3 + + - name: Validate composer.json and composer.lock + run: composer validate --strict + + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v3 + with: + path: vendor + key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-php- + + - name: Install dependencies + run: composer install --prefer-dist --no-progress --no-suggest + + - name: Run test suite + run: composer test \ No newline at end of file diff --git a/composer.json b/composer.json index 5b49516..ce1e34c 100644 --- a/composer.json +++ b/composer.json @@ -23,5 +23,8 @@ }, "require-dev": { "phpunit/phpunit": "^11.5" + }, + "scripts": { + "test": "vendor/bin/phpunit tests" } } From 9c470e481fef70b26aa3e31d8810e79d69fbd37d Mon Sep 17 00:00:00 2001 From: naingaunglwin-dev Date: Tue, 9 Dec 2025 15:02:33 +0630 Subject: [PATCH 2/2] remove version field from composer.json --- composer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/composer.json b/composer.json index ce1e34c..1a6e8df 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,6 @@ "name": "naingaunglwin-dev/timetracker", "description": "A lightweight time tracker for php", "minimum-stability": "stable", - "version": "1.0.0", "type": "library", "prefer-stable": true, "license": "MIT",