Private
Public Access
1
0

new: pkg: add CI/CD improvements - add new CI workflow - & improve the deployment w/ tests #10

This commit is contained in:
2026-04-21 17:58:05 +02:00
parent d704be5bff
commit e48d651eb5
5 changed files with 819 additions and 11 deletions

View File

@@ -1,6 +1,6 @@
# Mine-Seeker Game Documentation
This directory contains comprehensive documentation about the Mine-Seeker game mechanics, testing, and implementation.
This directory contains comprehensive documentation about the Mine-Seeker game mechanics, testing, and deployment.
## Game Mechanics
@@ -25,6 +25,7 @@ Complete testing setup and best practices including:
- Test environment configuration
- Database isolation with DAMA Doctrine Test Bundle
- Test database setup (`mineseeker_test`)
- Modern PHPUnit attributes (`#[Test]`, `#[TestDox]`)
- Writing effective tests
- Running tests (all, specific, with coverage)
- Best practices (AAA pattern, factories, type hints)
@@ -44,6 +45,43 @@ Detailed API reference for Zenstruck Foundry factories:
**Recommended for**: Writing tests with test data, understanding factory patterns, creating complex test scenarios.
### [Quick Reference](./testing/QUICK_REFERENCE.md)
Quick command reference for testing:
- Common test commands
- Factory usage cheat sheet
- Troubleshooting tips
**Recommended for**: Quick lookups during development.
---
## CI/CD & Deployment
### [CI/CD Integration Guide](./CI_CD.md)
Comprehensive guide for continuous integration and deployment:
- Gitea Actions workflows (CI and CD pipelines)
- Automated testing on every push/PR
- Deployment process with pre-deployment testing
- Configuration requirements (secrets, variables)
- Rollback procedures
- Security considerations
- Performance optimization
- Monitoring and notifications
- Troubleshooting deployment issues
**Recommended for**: Understanding deployment pipeline, setting up CI/CD, debugging deployment failures, production operations.
### [CI/CD Quick Reference](./testing/CI_CD_QUICK_REFERENCE.md)
Quick reference for CI/CD operations:
- Common commands (testing, deployment, rollback)
- Workflow diagrams (CI and CD pipelines)
- Status badges for README
- Common issues and solutions
- Environment variables
- Monitoring links
**Recommended for**: Quick deployments, troubleshooting, day-to-day operations.
---
## Technical Documentation
@@ -60,6 +98,14 @@ TrueType fonts used for server-side image generation:
## Quick Reference
### Test Suite Overview
| Metric | Value |
|--------|-------|
| Total Tests | 71 |
| Total Assertions | 227 |
| Execution Time | ~6-8 seconds |
| Coverage | Controller, DTO, Entity, Service, Integration |
### Bonus Points at a Glance
| Bonus Type | Points | Condition |
|-----------|--------|-----------|
@@ -84,24 +130,33 @@ TrueType fonts used for server-side image generation:
### Running Tests
```bash
# Recommended: Use Makefile
# Setup (first time only)
make test-db-setup
# Or manually:
# All tests
vendor/bin/phpunit
# Run all tests
make test
# Run with documentation output
vendor/bin/phpunit --testdox
# Specific file
vendor/bin/phpunit tests/Controller/ProfileControllerTest.php
# Specific method
vendor/bin/phpunit --filter testProfilePageRequiresAuthentication
# With coverage (requires Xdebug/PCOV)
XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-html coverage/
XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-html var/coverage
```
# With increased memory
php -d memory_limit=512M vendor/bin/phpunit
### CI/CD Commands
```bash
# Deploy to production
git tag -a v1.2.3 -m "Release version 1.2.3"
git push origin v1.2.3
# View CI/CD runs
# https://source.splendidbear.org/SplendidBear-Websites/Mine/actions
# Rollback deployment
git push origin v1.2.2 # Deploy previous version
```
---
@@ -121,6 +176,12 @@ php -d memory_limit=512M vendor/bin/phpunit
- PHPUnit Config: `/phpunit.dist.xml`
- Bundle Config: `/config/bundles.php`
### CI/CD
- CI Workflow: `/.gitea/workflows/ci.yml`
- CD Workflow: `/.gitea/workflows/deploy.yml`
- Dockerfile: `/Dockerfile`
- Docker Compose: `/compose.yaml`
---
## Additional Resources
@@ -130,3 +191,5 @@ php -d memory_limit=512M vendor/bin/phpunit
- **[Zenstruck Foundry](https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html)** - Official Foundry documentation
- **[PHPUnit](https://phpunit.de/)** - PHPUnit documentation
- **[Symfony Testing](https://symfony.com/doc/current/testing.html)** - Symfony testing guide
- **[Gitea Actions](https://docs.gitea.com/usage/actions/overview)** - Gitea Actions documentation
- **[Docker Compose](https://docs.docker.com/compose/)** - Docker Compose reference