new: pkg: add CI/CD improvements - add new CI workflow - & improve the deployment w/ tests #10
This commit is contained in:
73
README.md
73
README.md
@@ -304,3 +304,76 @@ For detailed information about game mechanics, bonus systems, fonts, testing, an
|
||||
LGPL-3.0 — see [LICENSE](LICENSE) for details.
|
||||
|
||||
© 2026 [SplendidBear](https://www.splendidbear.org)
|
||||
|
||||
---
|
||||
|
||||
## Testing & CI/CD
|
||||
|
||||
MineSeeker has a comprehensive test suite with **71 automated tests** and continuous integration/deployment pipelines.
|
||||
|
||||
### Quick Start
|
||||
|
||||
```bash
|
||||
# Setup test database (first time only)
|
||||
make test-db-setup
|
||||
|
||||
# Run all tests
|
||||
make test
|
||||
|
||||
# Run with documentation output
|
||||
vendor/bin/phpunit --testdox
|
||||
```
|
||||
|
||||
### Test Suite
|
||||
|
||||
- **71 tests** with **227 assertions**
|
||||
- **Controller tests** - HTTP endpoints, authentication, routing
|
||||
- **DTO tests** - Data serialization and calculations
|
||||
- **Entity tests** - Domain logic and defaults
|
||||
- **Service tests** - Business logic and external APIs
|
||||
- **Integration tests** - Foundry factories and database isolation
|
||||
|
||||
**Test execution time:** ~6-8 seconds
|
||||
|
||||
### Continuous Integration
|
||||
|
||||
**Automated testing** runs on every push/pull request:
|
||||
|
||||
```yaml
|
||||
# .gitea/workflows/ci.yml
|
||||
✓ PHP 8.3 setup with all extensions
|
||||
✓ PostgreSQL 18 service container
|
||||
✓ Composer and npm dependency installation
|
||||
✓ Asset building with Vite
|
||||
✓ Database migrations
|
||||
✓ Full test suite execution
|
||||
✓ Code linting (ESLint, PHP-CS-Fixer)
|
||||
```
|
||||
|
||||
### Continuous Deployment
|
||||
|
||||
**Automated deployment** on version tags (e.g., `v1.2.3`):
|
||||
|
||||
```yaml
|
||||
# .gitea/workflows/deploy.yml
|
||||
1. Run full test suite (blocks deployment if fails)
|
||||
2. Checkout tagged version
|
||||
3. Build Docker image
|
||||
4. Run database migrations
|
||||
5. Restart services
|
||||
6. Health check verification
|
||||
```
|
||||
|
||||
**Deploy to production:**
|
||||
```bash
|
||||
git tag -a v1.2.3 -m "Release version 1.2.3"
|
||||
git push origin v1.2.3
|
||||
```
|
||||
|
||||
### Documentation
|
||||
|
||||
- **[Testing Guide](docs/testing/TESTING.md)** - Comprehensive testing documentation
|
||||
- **[Factory Reference](docs/testing/FACTORIES.md)** - Foundry factory API
|
||||
- **[CI/CD Guide](docs/CI_CD.md)** - Pipeline configuration and workflows
|
||||
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user