64 lines
1.5 KiB
YAML
64 lines
1.5 KiB
YAML
# GitLab CI Configuration for Team Tools
|
|
# Copy this file to .gitlab-ci.yml in your repository
|
|
|
|
stages:
|
|
- validate
|
|
- test
|
|
- deploy
|
|
|
|
variables:
|
|
PYTHON_VERSION: "3.11"
|
|
GO_VERSION: "1.21"
|
|
|
|
# Validate team configurations
|
|
validate_teams:
|
|
stage: validate
|
|
image: python:$PYTHON_VERSION
|
|
script:
|
|
- pip install -r requirements.txt
|
|
- python3 scripts/team_manager.py --project $CI_PROJECT_NAME validate-size
|
|
- python3 scripts/team_manager.py --project $CI_PROJECT_NAME status
|
|
rules:
|
|
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
|
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
|
|
|
# Run unit tests
|
|
test_python:
|
|
stage: test
|
|
image: python:$PYTHON_VERSION
|
|
script:
|
|
- pip install -r requirements.txt
|
|
- pip install pytest pytest-cov
|
|
- pytest scripts/ -v --cov=scripts --cov-report=xml
|
|
coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/'
|
|
artifacts:
|
|
reports:
|
|
coverage_report:
|
|
coverage_format: cobertura
|
|
path: coverage.xml
|
|
|
|
test_go:
|
|
stage: test
|
|
image: golang:$GO_VERSION
|
|
script:
|
|
- cd mcp-server
|
|
- go test ./... -v -race -coverprofile=coverage.out
|
|
- go tool cover -func=coverage.out
|
|
artifacts:
|
|
paths:
|
|
- mcp-server/coverage.out
|
|
|
|
# Deploy team configuration (if needed)
|
|
deploy_teams:
|
|
stage: deploy
|
|
image: python:$PYTHON_VERSION
|
|
script:
|
|
- echo "Team configuration validated and ready for deployment"
|
|
- python3 scripts/team_manager.py --project $CI_PROJECT_NAME export-json --file teams-export.json
|
|
artifacts:
|
|
paths:
|
|
- teams-export.json
|
|
only:
|
|
- main
|
|
- master
|