-
Notifications
You must be signed in to change notification settings - Fork 0
cicd
Teko uses GitHub Actions for Continuous Integration and Continuous Deployment, ensuring code quality and streamlined deployment.
The CI/CD pipeline for Teko is designed to handle both PHP (Laravel) and Python (Agents) components, with specialized workflows for each. It follows a trunk-based development approach with the main branch as the source of truth.
The main workflow (main.yml) runs on every push and pull request to main branches and performs:
- PHP Tests: Linting, static analysis, and unit tests for Laravel components
- Python Tests: Linting, static analysis, and unit tests for agent components
- Docker Build: Builds and pushes container images to GitHub Container Registry
- Release Creation: Automatically creates GitHub releases
In addition to running tests, the CI/CD pipeline also:
- Syncs documentation to the wiki (via the
wiki-sync.ymlworkflow) - Applies repository configuration settings (via the
repo-config.ymlworkflow)
This ensures that both code quality and repository configuration remain consistent.
The security workflow (security.yml) runs on merges to main branches and weekly, providing:
- Security Scans: Checks dependencies for vulnerabilities
PHP code is tested with multiple tools:
- Laravel Pint: Code style enforcement
- PHPStan: Static analysis for PHP
- Psalm: Type checking and additional static analysis
- PHPUnit: Unit and feature tests
Python agents are tested with:
- Black/isort: Code formatting
- Flake8: Style guide enforcement
- MyPy: Type checking
- pytest: Unit testing
The pipeline automatically sets up appropriate environments:
- PHP 8.2 with required extensions
- Python 3.10 with LangChain dependencies
- MySQL database for integration tests
After successful tests, the CI pipeline automatically:
- Builds Docker containers for the application
- Tags with both
latestand a version-specific tag (YYYYMMDD-commitor the git tag) - Pushes containers to GitHub Container Registry (ghcr.io)
Containers follow this naming structure:
ghcr.io/owner/teko:tag
Where:
-
owneris the GitHub repository owner -
tagis eitherlatestor a version identifier
The CI/CD pipeline creates GitHub releases automatically when:
- Tests pass successfully
- The commit is to the main/master branch
Releases include:
- Automatically generated release notes
- Version tag based on date and commit or git tag
- Links to the Docker container images
You can run the same tests locally using the Make commands:
# Run PHP tests
make test-php
# Run Python tests
make test-python
# Run all tests
make test
# Build Docker container locally
make docker-buildFor more information on working with Docker containers, see the Deployment Guide.