-
Notifications
You must be signed in to change notification settings - Fork 5
97 lines (85 loc) · 2.88 KB
/
Copy pathlifecycle.yml
File metadata and controls
97 lines (85 loc) · 2.88 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
name: Full Lifecycle Tests
# Expensive — makes real LLM API calls.
# NOT triggered by push or PR. Manual dispatch or weekly schedule only.
on:
workflow_dispatch:
inputs:
mode:
description: 'Test mode'
required: false
default: 'cli'
type: choice
options: [cli, api, web, all]
model:
description: 'LLM model (haiku = cheaper, sonnet = stronger)'
required: false
default: 'haiku'
type: choice
options: [haiku, sonnet]
schedule:
# Weekly — Sunday 3am UTC
- cron: '0 3 * * 0'
env:
PYTHON_VERSION: '3.11'
NODE_VERSION: '20'
jobs:
lifecycle:
name: Lifecycle (${{ inputs.mode || 'cli' }} / ${{ inputs.model || 'haiku' }})
runs-on: ubuntu-latest
environment: staging
timeout-minutes: 60
steps:
- name: Checkout code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install uv
uses: astral-sh/setup-uv@38f3f104447c67c051c4a08e39b64a148898af3a # v4
with:
enable-cache: true
- name: Install dependencies
run: |
uv venv
uv sync --extra dev
uv pip install -e .
- name: Configure git
run: |
git config --global user.name "Lifecycle Test"
git config --global user.email "lifecycle@codeframe.test"
- name: Resolve test selection
id: tests
run: |
MODE="${{ inputs.mode || 'cli' }}"
case "$MODE" in
cli) echo "path=tests/lifecycle/test_cli_lifecycle.py" >> "$GITHUB_OUTPUT" ;;
api) echo "path=tests/lifecycle/test_api_lifecycle.py" >> "$GITHUB_OUTPUT" ;;
web) echo "path=tests/lifecycle/test_web_lifecycle.py" >> "$GITHUB_OUTPUT" ;;
all) echo "path=tests/lifecycle/" >> "$GITHUB_OUTPUT" ;;
esac
- name: Run lifecycle tests
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
CODEFRAME_LIFECYCLE_MODEL: ${{ inputs.model || 'haiku' }}
run: |
mkdir -p artifacts
uv run pytest ${{ steps.tests.outputs.path }} \
-m lifecycle \
-v \
--tb=long \
--no-header \
-p no:warnings \
--timeout=1800 \
--basetemp=artifacts/pytest \
2>&1 | tee artifacts/pytest.log
exit "${PIPESTATUS[0]}"
- name: Upload test artifacts on failure
if: failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: lifecycle-failure-${{ github.run_id }}
path: |
artifacts/
retention-days: 7
if-no-files-found: warn