Continuous Integration

Edit on GitHub

Continuous Integration (CI) is essential for maintaining code quality, project stability, and upgradability in Spryker projects. This document lists all validation commands from the Spryker demo shop CI pipeline that you can run locally before committing code.

Importance of CI for Spryker projects

All CI checks are mandatory for:

  • Project stability: Prevents breaking changes from reaching production
  • Code quality: Enforces coding standards and architectural patterns
  • Upgradability: Ensures compatibility with Spryker core updates
  • Early issue detection: Catches bugs, security vulnerabilities, and violations before deployment

Skipping CI checks leads to technical debt, integration issues, and costly refactoring.

Reference CI implementation

The Spryker B2B Demo Marketplace includes a comprehensive GitHub Actions CI workflow: .github/workflows/ci.yml.

It is recommended to review all available CI workflows in the Spryker workflows directory and adapt the relevant ones for the project. Not all workflows may be applicable to the specific requirements, so select and configure only those that align with the project needs.

For instructions on setting up CI in different repositories, see the following documents:

Validation commands

Use these commands to validate your code before merging it to the main branch.

Security scanning

Credential leak detection

# Using TruffleHog (install separately)
trufflehog filesystem . --log-level=2 --results=verified

Code validation

Schema and transfer validation

# Validate Propel schemas
vendor/bin/console propel:schema:validate
vendor/bin/console propel:schema:validate-xml-names

# Validate transfer objects
vendor/bin/console transfer:validate

Static code analysis

Code style checks

# PHP code style (PHPMD)
vendor/bin/console code:sniff:style

# Architecture sniffer (Spryker conventions)
vendor/bin/phpmd src/ text vendor/spryker/architecture-sniffer/src/ruleset.xml

Static analysis

# PHPStan (type checking and analysis at level 6)
vendor/bin/phpstan analyze -l 6 -c phpstan.neon src/

# Spryker Evaluator (upgradability and compatibility checks)
vendor/bin/evaluator evaluate --format=compact

Frontend validation

JavaScript and CSS checks


# Yves (storefront) validation
npm run yves:stylelint
npm run yves:lint

# Code formatting
npm run formatter

# Marketplace frontend validation
npm run mp:lint
npm run mp:stylelint
npm run mp:test

Automated testing

Acceptance and API tests

# Run acceptance tests
docker/sdk testing codecept run -c codeception.acceptance.yml

# Run API tests
docker/sdk testing codecept run -c codeception.api.yml

Functional tests

# Run functional tests
docker/sdk testing codecept run -c codeception.ci.functional.yml

Extending CI with Project Architecture Sniffer

The Project Architecture Sniffer enforces Spryker architectural standards and detects violations:

- name: Architecture Sniffer
  run: vendor/bin/phpmd src/Pyz/ text vendor/spryker/project-architecture-sniffer/src/ruleset.xml --minimumpriority 3

Comprehensive CI validation is essential for maintaining a stable, upgradable, and high-quality Spryker project.