From 02e95cc9f47382d2785a676189564ac27855c331 Mon Sep 17 00:00:00 2001 From: Blake Simpson Date: Sat, 26 Sep 2026 05:54:48 +0800 Subject: [PATCH 1/5] ci: add github actions ci.yml manifest --- .github/workflows/ci.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..8a1c701 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,32 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + +jobs: + checks: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: shivammathur/setup-php@v2 + with: + php-version: '8.5' + extensions: pdo_pgsql + ini-file: development + coverage: none + + - name: Cache Composer + uses: actions/cache@v4 + with: + path: ~/.cache/composer + key: composer-${{ hashFiles('composer.lock') }} + + - run: composer install --no-interaction --no-progress --prefer-dist + + - run: composer format:check + - run: composer lint + - run: composer analyze + - run: composer test From 263b66677404f337aabb12c6f924447cc70f7a0b Mon Sep 17 00:00:00 2001 From: Blake Simpson Date: Sat, 26 Sep 2026 05:57:31 +0800 Subject: [PATCH 2/5] ci: testing ci runs when code is comitted without being linted --- public/index.php | 1 + 1 file changed, 1 insertion(+) diff --git a/public/index.php b/public/index.php index ab6d60a..b16d371 100644 --- a/public/index.php +++ b/public/index.php @@ -8,6 +8,7 @@ use LaminasApiSample\Http\JsonResponseFactory; use LaminasApiSample\Http\Router; use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; try { require dirname(__DIR__) . '/bootstrap.php'; From 47e7bcc25172ed2863f8de688e7d4e61d3e02905 Mon Sep 17 00:00:00 2001 From: Blake Simpson Date: Sat, 26 Sep 2026 06:03:19 +0800 Subject: [PATCH 3/5] ci: ensure fail on warnings for linting, add further includes for Mago --- composer.json | 4 ++-- mago.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 5ded830..cf11617 100644 --- a/composer.json +++ b/composer.json @@ -44,10 +44,10 @@ } }, "scripts": { - "analyze": "mago analyze", + "analyze": "mago analyze --minimum-fail-level=warning", + "lint": "mago lint --minimum-fail-level=warning", "format": "mago format", "format:check": "mago format --dry-run", - "lint": "mago lint", "test": "phpunit", "serve": [ "Composer\\Config::disableProcessTimeout", diff --git a/mago.toml b/mago.toml index 1fd4010..9630948 100644 --- a/mago.toml +++ b/mago.toml @@ -6,7 +6,7 @@ php-version = "8.5.0" [source] workspace = "." -paths = ["src/", "test/"] +paths = ["src/", "test/", "public/", "bin/", "config/", "bootstrap.php"] includes = ["vendor/"] excludes = ["migrations/"] From cf97a3a12113ff13d9f31299e207bf871ae48922 Mon Sep 17 00:00:00 2001 From: Blake Simpson Date: Sat, 26 Sep 2026 06:05:13 +0800 Subject: [PATCH 4/5] ci: reverted deliberate lint warning --- public/index.php | 1 - 1 file changed, 1 deletion(-) diff --git a/public/index.php b/public/index.php index b16d371..ab6d60a 100644 --- a/public/index.php +++ b/public/index.php @@ -8,7 +8,6 @@ use LaminasApiSample\Http\JsonResponseFactory; use LaminasApiSample\Http\Router; use Psr\Container\ContainerExceptionInterface; -use Psr\Container\NotFoundExceptionInterface; try { require dirname(__DIR__) . '/bootstrap.php'; From fbfd811f4170ca0d33ac510afd2b97df5d91e154 Mon Sep 17 00:00:00 2001 From: Blake Simpson Date: Sat, 26 Sep 2026 06:14:25 +0800 Subject: [PATCH 5/5] docs: include CI badge --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 3505c38..33407c3 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ + # laminas-api-sample +![CI](https://github.com/blakesimpson-dev/laminas-api-sample/actions/workflows/ci.yml/badge.svg) + A learning project using PHP 8.5, Laminas and Doctrine: a small REST backend modelled on a slice of the [Path of Exile developer API](https://www.pathofexile.com/developer/docs/reference).