84 lines
2 KiB
YAML
84 lines
2 KiB
YAML
# GitLab CI/CD Pipeline for OpenCompletion
|
|
# Uses shell executor on build-tagged runners
|
|
|
|
stages:
|
|
- test
|
|
- lint
|
|
|
|
variables:
|
|
SQLALCHEMY_DATABASE_URI: "sqlite:///:memory:"
|
|
TESTING: "1"
|
|
MODEL_ENDPOINT_0: "https://hermes.ai.unturf.com/v1"
|
|
MODEL_API_KEY_0: "dummy"
|
|
|
|
# Template for Python setup (shell executor)
|
|
.python_setup:
|
|
tags:
|
|
- build
|
|
before_script:
|
|
- 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
|
|
|
|
# Unit Tests
|
|
unit_tests:
|
|
extends: .python_setup
|
|
stage: test
|
|
script:
|
|
- source venv/bin/activate
|
|
- pytest tests/unit/ -v --tb=short --cov=. --cov-report=term-missing
|
|
|
|
# Functional Tests
|
|
functional_tests:
|
|
extends: .python_setup
|
|
stage: test
|
|
script:
|
|
- source venv/bin/activate
|
|
- pytest tests/functional/ -v --tb=short
|
|
|
|
# Integration Tests
|
|
integration_tests:
|
|
extends: .python_setup
|
|
stage: test
|
|
script:
|
|
- source venv/bin/activate
|
|
- pytest tests/integration/ -v --tb=short
|
|
|
|
# Validate Activity YAML Files
|
|
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:
|
|
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 --exclude=venv
|
|
|
|
# Lint - Style Warnings (non-blocking)
|
|
lint_style:
|
|
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 --exclude=venv . || true
|
|
- flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --exclude=venv
|
|
allow_failure: true
|