-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (39 loc) · 1.27 KB
/
api-tests.yml
File metadata and controls
46 lines (39 loc) · 1.27 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
name: API Integration Tests
on:
workflow_dispatch: # Manual trigger only
inputs:
reason:
description: 'Reason for running API tests (costs money)'
required: true
type: string
jobs:
api-tests:
name: Run API Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev,embeddings]"
- name: Run API integration tests
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
run: |
pytest -m api -v --tb=short
- name: Comment on PR
if: github.event_name == 'pull_request'
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.name,
body: '✅ API integration tests passed!\n\n**Note:** These tests make real API calls and cost approximately $0.10-0.20.\n\n**Reason:** ${{ github.event.inputs.reason }}'
})