Sigwin's default per-project infra
Project description
Sigwin Infra
Sigwin's default per-project infra.
Project Overview
Sigwin Infra is a reusable infrastructure framework that provides standardized Makefiles for different project types (PHP libraries, Symfony applications, Pimcore applications, Node.js projects, etc.). Projects consume these resources by including the appropriate .mk files in their Makefiles.
Architecture
Resource System
The resources/ directory contains modular Makefile includes organized by technology and purpose:
- Common: Platform-agnostic and platform-specific (Linux/Darwin/Windows) base configuration
- PHP: PHP library, monorepo library, and PHAR building targets
- Symfony: Symfony application-specific targets (extends PHP)
- Pimcore: Pimcore application-specific targets (extends PHP)
- Node: Node.js tooling via Docker
- Compose: Docker Compose orchestration (build, start, stop, shell access)
- Secrets: Secret file management from
.disttemplates - Monorepo: Multi-package repository support
- YASSG: Static site generation support
- Gitlab/Lighthouse/Visual: CI/CD and testing integrations
Inclusion Pattern
Resources follow an inheritance model:
PHP/library.mkincludesPHP/common.mkSymfony/common.mkincludesPHP/common.mkSymfony/application.mkincludesSymfony/common.mk+Compose/common.mk- All resources include
Common/default.mkfor base functionality
Each resource defines SIGWIN_INFRA_ROOT to locate the resource directory, enabling consumption from vendor or monorepo locations.
Docker-Based Tooling
All PHP and Node.js commands run inside Docker containers to ensure consistent environments:
- PHP: Uses
jakzal/phpqaimage (configurable viaPHPQA_DOCKER_IMAGE) - Node: Uses official
node:alpineimage - Containers mount the project directory, home directory caches, and execute with host user permissions
Init System
The init target (in Common/default.mk) copies distribution files from resource directories to consuming projects. Each resource directory can contain template files that get copied during initialization.
Common Commands
Help
make help # Show all available targets
PHP Library Projects
make dist # Run all checks (normalize, cs, analyze, test)
make analyze # Run all analysis tools (composer, cs, phpstan, psalm)
make cs # Fix code style issues
make analyze/cs # Check code style (dry-run)
make analyze/phpstan # Run PHPStan static analysis
make analyze/psalm # Run Psalm static analysis
make test # Run tests with mutation testing
make test/phpunit # Run PHPUnit tests only
make test/phpunit-coverage # Run PHPUnit with coverage
make test/infection # Run Infection mutation testing (requires coverage)
make sh/php # Open PHP shell in Docker container
make composer/install # Install dependencies
make composer/normalize # Normalize composer.json
Symfony/Pimcore Application Projects
All PHP library commands plus:
make build/dev # Build Docker images for dev environment
make build/prod # Build Docker images for prod environment
make start/dev # Start application in dev mode
make start/test # Start application in test mode
make start/prod # Start application in prod mode
make stop # Stop running application
make sh/app # Open shell in application container
make test/behat # Run Behat functional tests
make setup/test # Setup test database and environment
make setup/filesystem # Create and configure var directories
make clean # Clear logs and caches
Node Application Projects
make dist # Run all checks (analyze, test)
make analyze # Run all analysis tools (lint, type-check)
make analyze/lint # Run linter
make analyze/type-check # Run type checking
make test # Run tests (unit + functional)
make test/vitest # Run Vitest unit tests
make test/e2e # Run end-to-end tests
make build/dev # Build Docker images for dev environment
make build/prod # Build Docker images for prod environment
make start/dev # Start application in dev mode
make start/test # Start application in test mode
make start/prod # Start application in prod mode
make stop # Stop running application
make sh/app # Open shell in application container
make sh/node # Open Node shell in Docker container
make setup/test # Setup test environment
make setup/filesystem # Create and configure var directories
make clean # Clear logs and caches
Environment Configuration
Docker Compose projects automatically copy .env.dist to .env if .env doesn't exist (see Compose/common.mk).
Secrets management: .infra/secrets/*.secret.dist files are copied to *.secret via the secrets target.
Testing
Tests are located in tests/functional/ and validate that the Makefile resources work correctly. Each test extends MakefileTestCase which:
- Creates temporary project directories
- Copies resource files
- Executes Make commands
- Validates expected behavior
Run tests with make test/phpunit (which runs PHPUnit).
Development Workflow
Installing as a Dependency
Sigwin Infra is designed to be installed using your stack's native dependency management tool:
- PHP/Composer:
composer require --dev sigwin/infra - Node/npm:
npm install --save-dev @sigwinhq/infra - Python (Pip/Poetry/UV):
pip install sigwin-infra(orpoetry add --group dev sigwin-infra,uv add --dev sigwin-infra)
The package provides the same Makefile resources regardless of installation method. More stacks may be added in the future following the same pattern.
Integration Steps
- Bootstrap: Use
resources/PHP/library/Makefilepattern to download infra on first run (PHP projects) - Including resources: Add
include vendor/sigwin/infra/resources/<Type>/<file>.mkto project Makefile (ornode_modules/@sigwinhq/infra/resources/...for npm) - Version-specific configs: Use
file_prefixfunction to support PHP version-specific config files (e.g.,8.4-phpstan.neon.dist) - Platform detection:
OS_FAMILYautomatically detects Linux/Darwin/Windows and includes platform-specific configuration
Quality Standards
- PHPStan: Level max with strict and deprecation rules
- Psalm: Strict mode with PHP version enforcement
- PHP-CS-Fixer: Configured via
resources/PHP/php-cs-fixer.php - Infection: 100% MSI requirement with sensible mutator configuration
GitHub Actions Integration
The block_start and block_end functions automatically wrap command output in GitHub Actions groups when GITHUB_ACTIONS environment variable is set.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sigwin_infra-1.21.0.tar.gz.
File metadata
- Download URL: sigwin_infra-1.21.0.tar.gz
- Upload date:
- Size: 19.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b34b00418755b07f306cd1bb6e6a426b63650c0dcaa24e1eb9f191d03288a8c5
|
|
| MD5 |
ee71e552d452e0899a6a99a86f7d5d34
|
|
| BLAKE2b-256 |
f2f583d9633072c09e1df1ba7358c279425fb9e02cb86a117742b777b260c7d3
|
Provenance
The following attestation bundles were made for sigwin_infra-1.21.0.tar.gz:
Publisher:
release.yaml on sigwinhq/infra
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sigwin_infra-1.21.0.tar.gz -
Subject digest:
b34b00418755b07f306cd1bb6e6a426b63650c0dcaa24e1eb9f191d03288a8c5 - Sigstore transparency entry: 658459042
- Sigstore integration time:
-
Permalink:
sigwinhq/infra@0c819883db2300585873bc8feea496cb91a9314f -
Branch / Tag:
refs/tags/1.21.0 - Owner: https://github.com/sigwinhq
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@0c819883db2300585873bc8feea496cb91a9314f -
Trigger Event:
release
-
Statement type:
File details
Details for the file sigwin_infra-1.21.0-py3-none-any.whl.
File metadata
- Download URL: sigwin_infra-1.21.0-py3-none-any.whl
- Upload date:
- Size: 41.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9613ac647bfb996cfe48ad44161dfde12d6cd124d77ddd54b573f76b3124bf5c
|
|
| MD5 |
05bf911120ded0c0526c634f018df380
|
|
| BLAKE2b-256 |
1d7c2ad8f3ef010185fdd98dc2a8d81d54e72ead677d28a8db919027149a0e8f
|
Provenance
The following attestation bundles were made for sigwin_infra-1.21.0-py3-none-any.whl:
Publisher:
release.yaml on sigwinhq/infra
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sigwin_infra-1.21.0-py3-none-any.whl -
Subject digest:
9613ac647bfb996cfe48ad44161dfde12d6cd124d77ddd54b573f76b3124bf5c - Sigstore transparency entry: 658459057
- Sigstore integration time:
-
Permalink:
sigwinhq/infra@0c819883db2300585873bc8feea496cb91a9314f -
Branch / Tag:
refs/tags/1.21.0 - Owner: https://github.com/sigwinhq
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@0c819883db2300585873bc8feea496cb91a9314f -
Trigger Event:
release
-
Statement type: