chore: initialize project infrastructure and CI configuration

This commit is contained in:
Funky Waddle 2026-02-21 19:12:29 -06:00
commit 7cb01ed6ab
5 changed files with 87 additions and 0 deletions

32
.github/workflows/ci.yml vendored Normal file
View file

@ -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

3
.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
/vendor/
/.phpunit.cache/
/composer.lock

23
composer.json Normal file
View file

@ -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/"
}
}
}

5
phpstan.neon Normal file
View file

@ -0,0 +1,5 @@
parameters:
level: 8
paths:
- src
treatPhpDocTypesAsCertain: false

24
phpunit.xml Normal file
View file

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
cacheDirectory=".phpunit.cache"
executionOrder="depends,defects"
beStrictAboutOutputDuringTests="true"
failOnRisky="true"
failOnWarning="true">
<testsuites>
<testsuite name="Phred ConsoleContracts Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<coverage/>
<source>
<include>
<directory suffix=".php">src</directory>
</include>
</source>
</phpunit>