Fix GitLab CI for shell executor: use python3 and venv

This commit is contained in:
Russell Ballestrini 2026-01-11 08:32:35 -05:00
parent 6a4d9d560b
commit 4cc7e61c8b

View file

@ -1,30 +1,24 @@
# GitLab CI/CD Pipeline for OpenCompletion
# Mirrors GitHub Actions workflow for consistency across platforms
# Uses shell executor on build-tagged runners
stages:
- test
- lint
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
SQLALCHEMY_DATABASE_URI: "sqlite:///:memory:"
TESTING: "1"
MODEL_ENDPOINT_0: "https://hermes.ai.unturf.com/v1"
MODEL_API_KEY_0: "dummy"
# Cache pip dependencies between jobs
cache:
paths:
- .cache/pip
- venv/
# Template for Python setup
# Template for Python setup (shell executor)
.python_setup:
image: python:3.13-slim
tags:
- build
before_script:
- python -m pip install --upgrade pip
- python3 -m venv venv
- source venv/bin/activate
- python3 -m pip install --upgrade pip
- pip install -r requirements.txt
- pip install -r requirements-test.txt
@ -33,18 +27,15 @@ unit_tests:
extends: .python_setup
stage: test
script:
- source venv/bin/activate
- pytest tests/unit/ -v --tb=short --cov=. --cov-report=term-missing
artifacts:
when: always
reports:
junit: report.xml
expire_in: 1 week
# Functional Tests
functional_tests:
extends: .python_setup
stage: test
script:
- source venv/bin/activate
- pytest tests/functional/ -v --tb=short
# Integration Tests
@ -52,6 +43,7 @@ integration_tests:
extends: .python_setup
stage: test
script:
- source venv/bin/activate
- pytest tests/integration/ -v --tb=short
# Validate Activity YAML Files
@ -59,29 +51,34 @@ validate_yaml:
extends: .python_setup
stage: test
script:
- source venv/bin/activate
- python activity_yaml_validator.py research/SPEC.yaml
- python activity_yaml_validator.py research/activity*.yaml
# Lint - Syntax Errors (blocking)
lint_syntax:
image: python:3.13-slim
stage: lint
tags:
- build
before_script:
- python3 -m venv venv
- source venv/bin/activate
- pip install flake8
script:
- source venv/bin/activate
- flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# Lint - Style Warnings (non-blocking)
lint_style:
image: python:3.13-slim
stage: lint
tags:
- build
before_script:
- python3 -m venv venv
- source venv/bin/activate
- pip install black flake8
script:
- source venv/bin/activate
- black --check --diff . || true
- flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
allow_failure: true