Files
doczyai-pipelines/bitbucket-pipelines.yml
T

68 lines
1.9 KiB
YAML
Raw Normal View History

2024-09-23 16:14:05 +01:00
definitions:
2024-09-23 16:28:03 +01:00
scripts:
- script: &install
pip install uv;
uv sync --group dev --group test;
2026-03-16 19:39:05 +00:00
steps:
- step: &install-deps
name: Install Dependencies
image: python:3.12.7
script:
- *install
caches:
- pip
2026-03-16 19:39:05 +00:00
- step: &lint
name: Lint (black)
image: python:3.12.7
script:
- *install
- uv run black --check src/
caches:
- pip
- step: &typecheck
name: Type Check (mypy)
image: python:3.12.7
script:
- *install
- uv run mypy src/
caches:
- pip
- step: &unit-tests
name: Unit Tests (pytest)
image: python:3.12.7
script:
- *install
- uv run pytest src/tests/
caches:
- pip
pipelines:
default:
- step: *install-deps
- parallel:
2026-03-16 19:39:05 +00:00
- step: *lint
- step: *typecheck
- step: *unit-tests
pull-requests:
'**':
- step: *install-deps
- parallel:
- step: *lint
- step: *typecheck
- step: *unit-tests
- step:
name: AI Code Review
image: python:3.12-slim
oidc: true
script:
- apt-get update && apt-get install -y git
- pip install boto3 requests
- export AWS_REGION=us-east-1
- export AWS_ROLE_ARN=arn:aws:iam::975049960860:role/DoczyAI-Bitbucket-OIDC
- export AWS_WEB_IDENTITY_TOKEN_FILE=$(pwd)/web-identity-token
- echo $BITBUCKET_STEP_OIDC_TOKEN > $(pwd)/web-identity-token
- git clone https://x-token-auth:${BITBUCKET_CLONE_TOKEN}@bitbucket.org/${BITBUCKET_WORKSPACE}/code-review-agent.git
- export PR_URL="https://bitbucket.org/${BITBUCKET_WORKSPACE}/${BITBUCKET_REPO_SLUG}/pull-requests/${BITBUCKET_PR_ID}"
- cd code-review-agent && python main.py "$PR_URL"