-
Notifications
You must be signed in to change notification settings - Fork 9
190 lines (152 loc) · 4.84 KB
/
ci.yml
File metadata and controls
190 lines (152 loc) · 4.84 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# Continuous Integration workflow for Conductor
#
# Runs on:
# - Push to main branch
# - Pull requests to main branch
#
# Jobs:
# - lint: Runs ruff linter and formatter check
# - typecheck: Runs ty (Red Knot) type checker
# - test: Runs pytest with coverage on Python 3.12 and 3.13
# - validate-examples: Validates all example workflow YAML files
# - build: Verifies the package builds correctly
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
PYTHON_VERSION: "3.12"
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: "latest"
enable-cache: true
- name: Set up Python
run: uv python install ${{ env.PYTHON_VERSION }}
- name: Install dependencies
run: uv sync --group dev
- name: Run ruff linter
run: uv run ruff check src tests
- name: Run ruff formatter check
run: uv run ruff format --check src tests
typecheck:
name: Type Check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: "latest"
enable-cache: true
- name: Set up Python
run: uv python install ${{ env.PYTHON_VERSION }}
- name: Install dependencies
run: uv sync --group dev
- name: Run ty type checker
run: uv run ty check src
test:
name: Test (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
needs: [lint, typecheck]
strategy:
matrix:
python-version: ["3.12", "3.13"]
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: "latest"
enable-cache: true
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Install dependencies
run: uv sync --group dev
- name: Remove bundled Copilot CLI binary
run: |
# The github-copilot-sdk >=0.1.23 bundles a CLI binary that tries to
# authenticate with GitHub on startup. Remove it so tests that invoke
# the real CLI path fail fast instead of hanging on auth.
find .venv -path '*/copilot/bin/copilot*' -delete 2>/dev/null || true
- name: Run tests with coverage
timeout-minutes: 10
run: uv run pytest --cov=src/conductor --cov-report=xml --cov-report=term-missing -m "not real_api and not performance"
env:
# Fake API key for mock tests to prevent accidental real API calls.
# Real API tests (marked with @pytest.mark.real_api) are excluded from CI
# via the marker filter. Performance tests are also excluded as they
# contain timing-sensitive assertions that are flaky on shared CI runners.
# This ensures CI tests are fast, free, and don't leak credentials.
ANTHROPIC_API_KEY: "sk-ant-test-fake-key-for-mocking"
- name: Upload coverage reports
uses: codecov/codecov-action@v4
if: matrix.python-version == '3.12'
with:
file: ./coverage.xml
fail_ci_if_error: false
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
validate-examples:
name: Validate Example Workflows
runs-on: ubuntu-latest
needs: [lint]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: "latest"
enable-cache: true
- name: Set up Python
run: uv python install ${{ env.PYTHON_VERSION }}
- name: Install dependencies
run: uv sync
- name: Validate example workflows
run: |
for file in examples/*.yaml; do
echo "Validating $file..."
uv run conductor validate "$file"
done
build:
name: Build Package
runs-on: ubuntu-latest
needs: [test]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: "latest"
enable-cache: true
- name: Set up Python
run: uv python install ${{ env.PYTHON_VERSION }}
- name: Build package
run: uv build
- name: Verify package contents
run: |
ls -la dist/
uv run python -m zipfile -l dist/*.whl
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
retention-days: 7