Skip to main content

A tool to validate and simulate GitLab CI pipelines

Project description

Cimulator

A tool to validate and simulate GitLab CI pipelines without running them.

Overview

Cimulator is a Python tool designed to validate and simulate GitLab CI pipelines. It addresses the challenge of testing and validating complex CI/CD configurations without having to commit changes to a repository and wait for actual pipeline runs.

Features

  • Configuration Validation: Validates GitLab CI YAML files for syntax and structural errors
  • Include Resolution: Recursively processes all included YAML files
  • Job Expansion: Properly expands jobs according to the extends mechanism
  • Rule Evaluation: Evaluates workflow and job rules to determine which jobs would run
  • Variable Interpolation: Simulates how variables are expanded in different contexts
  • Pipeline Simulation: Provides a "dry run" of what a pipeline would look like

Installation

pip install cimulator

Or with Poetry:

poetry add cimulator

Basic Usage

# Validate a CI configuration file
cimulator validate path/to/your/.gitlab-ci.yml

# Simulate a pipeline run for the default branch
cimulator simulate path/to/your/.gitlab-ci.yml ci-config.yml profile

To simulate you will need a CI config file, which contains profiles for your CI. Typically you need to specify there the source of the pipeline and additional variables that you set in Gitlab CI.

Example

Consider the example CI in examples/complete.

You can validate and simulate this pipeline:

cimulator simulate examples/complete/.gitlab-ci.yml examples/complete/ci-config.yml MR
Root file: /Users/ibarkov/workspace/cimulator/examples/complete/.gitlab-ci.yml
Base path: /Users/ibarkov/workspace/cimulator/examples/complete

Warnings about job dependencies:
  - Job 'integration_test' needs job 'test_windows' which will not run in this pipeline
  - [Optional] Job 'test_mixed' needs job 'build_optnotrun' which will not run in this pipeline
Simulation successful. Output saved to /Users/ibarkov/workspace/cimulator/simulation_output.yml

License

MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cimulator-0.1.1.tar.gz (37.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cimulator-0.1.1-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

Details for the file cimulator-0.1.1.tar.gz.

File metadata

  • Download URL: cimulator-0.1.1.tar.gz
  • Upload date:
  • Size: 37.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.13.2 Darwin/24.3.0

File hashes

Hashes for cimulator-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ba0dc4d474106ff107744c3e0807f43ab375a0f4db6e154d15067186052f403c
MD5 17a81a1fa068a49487ea66dc24a7e6bf
BLAKE2b-256 1371dba594d5eacccdbb5c5de5dbf6c6d75f0ce243a13c0f727ccf669aa8bbb6

See more details on using hashes here.

File details

Details for the file cimulator-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: cimulator-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 16.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.13.2 Darwin/24.3.0

File hashes

Hashes for cimulator-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 87bdb816415e549b14a717e9c051653b0413985497aab172ee08c5dcb7860561
MD5 a3e17870552916e020185083f3ae26c7
BLAKE2b-256 34872c89ba9ec9ccc4623f1e860cd0c232ebe0632a9b076aa145c608748c4912

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page