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 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). 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/"]