diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d541fa1..d44ed51 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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