This directory contains GitLab CI/CD workflow configurations that mirror the functionality of the GitHub Actions workflows in .github/workflows/.
.gitlab/
├── workflows/
│ ├── rhiza_ci.yml # Continuous Integration - Python matrix testing
│ ├── rhiza_quality.yml # Quality checks (deptry, pre-commit, docs coverage, link check)
│ ├── rhiza_marimo.yml # Marimo notebook execution and artefact publishing
│ ├── rhiza_book.yml # Documentation building (GitLab Pages)
│ ├── rhiza_sync.yml # Template synchronization
│ └── rhiza_release.yml # Release workflow
├── template/ # GitLab CI job templates
│ └── marimo_job_template.yml.jinja
└── README.md # This file
.gitlab-ci.yml # Main GitLab CI configuration (includes all workflows)
Purpose: Run tests on multiple Python versions to ensure compatibility.
Trigger:
- On push to any branch
- On merge requests to main/master
Key Features:
- Dynamic Python version matrix generation
- Tests on Python 3.11, 3.12, 3.13
- Git LFS support
- UV package manager for dependency management
Equivalent GitHub Action: .github/workflows/rhiza_ci.yml
Purpose: Validate Rhiza configuration against template, run security scans and type checking.
Trigger:
- On push to any branch
- On merge requests to main/master
pip-auditjob only runs on scheduled pipelines
Key Features:
- Runs
make validate, which fires the full hook chain (pre-validate,rhiza-test,uvx rhiza validate .,post-validate) - Skips validation in the rhiza repository itself (handled internally by
make validate) - Runs
make security(pip-audit + bandit) on push/MR - Runs
uvx pip-auditon scheduled pipelines for dependency vulnerability scanning - Runs
make typecheck(ty type checker) on push/MR
Equivalent GitHub Action: .github/workflows/rhiza_validate.yml
Purpose: Run quality checks including dependency validation, pre-commit hooks, documentation coverage, and link checking.
Trigger:
- On push to any branch
- On merge requests to main/master
Key Features:
- Dependency checking with deptry (
make deptry) - Pre-commit hooks for code formatting and linting (
make fmt) - Documentation coverage validation (
make docs-coverage) - Link checking on README.md with lychee
Equivalent GitHub Action: .github/workflows/rhiza_quality.yml
Purpose: Run static analysis using Semgrep with local numpy rules to detect common NumPy-related bugs and security issues.
Trigger:
- On push to any branch
- On merge requests to main/master
Key Features:
- Runs
make semgrepusing.rhiza/semgrep.ymllocal rules - Skips if
SOURCE_FOLDERis not found
Equivalent GitHub Action: .github/workflows/rhiza_validate.yml (semgrep job)
Purpose: Check that no copyleft-licensed dependencies (GPL, LGPL, AGPL) have been introduced via transitive updates.
Trigger:
- On push to any branch
- On merge requests to main/master
Key Features:
- Runs
make licenseto fail on forbidden licenses - Generates
LICENSES.mdmarkdown report of all dependency licenses - Publishes
LICENSES.mdas a GitLab CI artifact (retained 30 days)
Equivalent GitHub Action: .github/workflows/rhiza_validate.yml (license job)
Purpose: Discover and execute all Marimo notebooks in the repository, publishing results as artefacts.
Trigger:
- On push to main/master branch
- On merge requests to main/master
Key Features:
- Discovers notebooks dynamically from
MARIMO_FOLDER(default:marimo) - Runs each notebook sequentially with
uv run fail-fast: falseequivalent — all notebooks are attempted even if one fails- Publishes
results/as GitLab CI artefacts (retained for 1 week) - Git LFS support
Equivalent GitHub Action: .github/workflows/rhiza_marimo.yml
Purpose: Build and deploy documentation to GitLab Pages.
Trigger:
- On push to main/master branch
Key Features:
- Combines API docs, test coverage, and notebooks
- Deploys to GitLab Pages
- Controlled by
PUBLISH_COMPANION_BOOKvariable
Equivalent GitHub Action: .github/workflows/rhiza_book.yml
GitLab-specific: Outputs to public/ directory for GitLab Pages.
Purpose: Synchronize repository with its template.
Trigger:
- Scheduled (can be set in GitLab)
- Manual trigger
- Web pipeline trigger
Key Features:
- Template materialization with rhiza
- Automatic branch creation
- Manual merge request creation
Equivalent GitHub Action: .github/workflows/rhiza_sync.yml
GitLab-specific: Requires Project/Group Access Token (PAT_TOKEN) for workflow modifications.
Purpose: Create releases and publish packages to PyPI.
Trigger:
- On version tags (e.g.,
v1.2.3)
Key Features:
- Version validation
- Python package building with Hatch
- PyPI publishing with twine
- GitLab release creation
Equivalent GitHub Action: .github/workflows/rhiza_release.yml
GitLab-specific:
- Uses GitLab Releases API instead of GitHub Releases
- Uses PYPI_TOKEN instead of OIDC Trusted Publishing
For a detailed side-by-side syntax comparison and per-feature breakdown, see COMPARISON.md.
These variables can be set in GitLab CI/CD settings (Settings > CI/CD > Variables):
| Variable | Default | Description |
|---|---|---|
UV_EXTRA_INDEX_URL |
"" |
Extra index URL for UV package manager |
PYPI_REPOSITORY_URL |
"" |
Custom PyPI repository URL (empty = pypi.org) |
PYPI_TOKEN |
N/A | Secret - PyPI authentication token |
PUBLISH_COMPANION_BOOK |
true |
Whether to publish documentation |
CREATE_MR |
true |
Whether to create merge request on sync |
PAT_TOKEN |
N/A | Secret - Project/Group Access Token for sync |
- Navigate to your GitLab project
- Go to Settings > CI/CD > Variables
- Click Add variable
- Enter the variable name and value
- Mark as Protected for production variables
- Mark as Masked for sensitive values
You can validate the GitLab CI configuration syntax using:
# Install GitLab CI Lint tool
curl --header "PRIVATE-TOKEN: <your_access_token>" \
"https://gitlab.com/api/v4/projects/<project_id>/ci/lint" \
--data-urlencode "content@.gitlab-ci.yml"Or use the GitLab UI:
- Go to CI/CD > Pipelines
- Click CI Lint button (or go to
/ci/lint) - Paste your
.gitlab-ci.ymlcontent - Click Validate
When migrating from GitHub Actions to GitLab CI:
- Set required CI/CD variables (especially secrets like
PYPI_TOKEN) - Configure Project/Group Access Token for
PAT_TOKEN(if using sync) - Enable GitLab Pages in project settings (if using book)
- Configure scheduled pipelines for sync workflow
- Update any repository-specific configurations
- Test each workflow individually
- Verify release workflow with a test tag
- Update documentation links
-
Pipeline fails with "permission denied"
- Check if required variables are set
- Verify token permissions
-
Pages deployment doesn't work
- Ensure job is named
pages - Verify artifacts are in
public/directory - Check if GitLab Pages is enabled
- Ensure job is named
-
Matrix jobs don't run in parallel
- GitLab CI has limitations on dynamic matrices
- Consider using child pipelines for true parallelism
-
Release workflow fails
- Verify
PYPI_TOKENis set - Check tag format (must start with
v) - Ensure version in pyproject.toml matches tag
- Verify
For issues specific to:
- GitLab CI syntax: Refer to GitLab CI/CD Documentation
- Rhiza workflows: See main repository README
- Workflow behavior: Compare with corresponding GitHub Actions workflows
When adding or modifying workflows:
- Update both
.gitlab/workflows/*.ymland.github/workflows/*.yml - Keep feature parity between GitHub Actions and GitLab CI
- Document any platform-specific differences
- Test changes in a fork before merging
- Update this README with new workflows or variables
These workflows are part of the jebel-quant/rhiza repository and follow the same license.