From 7cb01ed6ab7469efa02296e38e50a82a425c9c2c Mon Sep 17 00:00:00 2001 From: Funky Waddle Date: Sat, 21 Feb 2026 19:12:29 -0600 Subject: [PATCH] chore: initialize project infrastructure and CI configuration --- .github/workflows/ci.yml | 32 ++++++++++++++++++++++++++++++++ .gitignore | 3 +++ composer.json | 23 +++++++++++++++++++++++ phpstan.neon | 5 +++++ phpunit.xml | 24 ++++++++++++++++++++++++ 5 files changed, 87 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .gitignore create mode 100644 composer.json create mode 100644 phpstan.neon create mode 100644 phpunit.xml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..7ae6cd2 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,32 @@ +name: CI + +on: + push: + branches: [ main, master ] + pull_request: + +jobs: + console-contracts: + runs-on: ubuntu-latest + defaults: + run: + working-directory: ConsoleContracts + strategy: + matrix: + php: ['8.2', '8.3'] + steps: + - uses: actions/checkout@v4 + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: none + tools: phpstan, php-cs-fixer, phpunit + - name: Validate composer.json + run: php -v && composer validate --strict + - name: Install dependencies + run: composer install --no-interaction --no-progress --prefer-dist + - name: PHPUnit + run: vendor/bin/phpunit --configuration phpunit.xml --display-deprecations + - name: PHPStan + run: vendor/bin/phpstan analyse --no-progress --memory-limit=512M diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6ede8ef --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/vendor/ +/.phpunit.cache/ +/composer.lock diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..09e8e26 --- /dev/null +++ b/composer.json @@ -0,0 +1,23 @@ +{ + "name": "getphred/console-contracts", + "description": "Minimal, framework-agnostic console interfaces for the Phred Framework.", + "license": "MIT", + "type": "library", + "require": { + "php": "^8.2" + }, + "require-dev": { + "phpunit/phpunit": "^10.0", + "phpstan/phpstan": "^1.10" + }, + "autoload": { + "psr-4": { + "Phred\\ConsoleContracts\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "Phred\\ConsoleContracts\\Tests\\": "tests/" + } + } +} diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..ac454e0 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,5 @@ +parameters: + level: 8 + paths: + - src + treatPhpDocTypesAsCertain: false diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 0000000..5b4a1fb --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,24 @@ + + + + + tests + + + + + + + + src + + +