This repository was archived by the owner on Mar 9, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
123 lines (102 loc) · 3.36 KB
/
build.yml
File metadata and controls
123 lines (102 loc) · 3.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
---
# =====================================================================
# 🤖 AICodeBot CI/CD Pipeline 🤖
# =====================================================================
#
# This workflow handles the continuous integration and deployment of
# AICodeBot, the AI-powered coding assistant.
#
# 📊 Flow Structure:
# -----------------
# 1. lint-code: Quick static code analysis with ruff
# 2. test-python: Python backend tests across multiple Python versions
#
# 🔄 Job Dependencies:
# ------------------
# Jobs run in parallel for faster CI feedback.
# Package building and publishing is handled by pypi_release.yml workflow.
#
# 💫 Caching Strategy:
# ------------------
# - GitHub Actions cache for pip/uv dependencies
# - Pytest cache for faster test runs
#
# Remember: Helping developers code better, one commit at a time! 🚀
# =====================================================================
name: CI Tests 🤖
on:
# Run on PRs
pull_request:
branches: [main]
# Run on pushes to main
push:
branches: [main]
tags: ['v*']
# Allow manual triggers
workflow_dispatch:
permissions: read-all
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint-code:
name: 🧹 Lint code
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout Code
uses: actions/checkout@v5
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install uv (Rust-powered Python package manager)
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "PATH=$HOME/.local/bin:$PATH" >> $GITHUB_ENV
- name: Install ruff
run: uv pip install --system ruff
- name: Run ruff linter
run: ruff check .
- name: Run ruff formatter
run: ruff format --check .
test-python:
name: 🐍 Test Python code
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
python-version: ["3.12", "3.13"]
env:
# Skip live tests that require API keys in CI
SKIP_LIVE_TESTS: 1
steps:
- name: Checkout Code
uses: actions/checkout@v5
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Cache uv dependencies
uses: actions/cache@v4
with:
path: ~/.cache/uv
key: ${{ runner.os }}-uv-py${{ matrix.python-version }}-${{ hashFiles('requirements/requirements-test.txt') }}
restore-keys: |
${{ runner.os }}-uv-py${{ matrix.python-version }}-
- name: Install uv (Rust-powered Python package manager)
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "PATH=$HOME/.local/bin:$PATH" >> $GITHUB_ENV
- name: Install dependencies with uv
run: |
uv pip install --system -r requirements/requirements-test.txt
uv pip install --system -e .
- name: Run the tests with coverage
run: pytest --cov=aicodebot --cov-report=xml --cov-report=term-missing --record-mode=none
- name: Upload coverage to Codecov
if: matrix.python-version == '3.13'
uses: codecov/codecov-action@v5
with:
files: ./coverage.xml
fail_ci_if_error: false