-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (65 loc) · 2.25 KB
/
ci.yml
File metadata and controls
79 lines (65 loc) · 2.25 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
name: CI
on:
pull_request:
push:
branches:
- main
permissions:
contents: read
jobs:
test-and-validate:
runs-on: blacksmith-4vcpu-ubuntu-2404
timeout-minutes: 45
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Setup uv
uses: astral-sh/setup-uv@v5
- name: Install dependencies
run: uv sync --extra dev
- name: Run test suite
run: |
mkdir -p reports
uv run pytest -q --junitxml=reports/junit.xml
- name: Generate and validate Foundry OpenAPI artifact
run: |
uv run python scripts/deploy/foundry_openapi.py \
--generate \
--spec-path openapi.foundry.json \
--server-url http://localhost:5000
uv run python scripts/deploy/foundry_openapi.py \
--spec-path openapi.foundry.json \
--server-url http://localhost:5000
git diff --exit-code -- openapi.foundry.json
- name: Setup Blacksmith Builder
uses: useblacksmith/setup-docker-builder@v1
- name: Build image with Foundry OpenAPI label
run: |
OPENAPI_JSON="$(uv run python -c 'import json; print(json.dumps(json.load(open("openapi.foundry.json", encoding="utf-8")), separators=(",", ":")))')"
docker buildx build \
--platform linux/amd64 \
--build-arg SERVER_OPENAPI="${OPENAPI_JSON}" \
--tag dspy-reference-examples:ci \
--load \
.
- name: Validate image metadata contract
run: |
uv run python scripts/deploy/foundry_openapi.py \
--spec-path openapi.foundry.json \
--image-ref dspy-reference-examples:ci \
--server-url http://localhost:5000
- name: Run Docker portability smoke test
run: BUILD_IMAGE=0 IMAGE_NAME=dspy-reference-examples:ci bash scripts/test_docker_portability.sh
- name: Upload CI reports
if: always()
uses: actions/upload-artifact@v4
with:
name: ci-reports
path: |
reports/junit.xml
openapi.foundry.json
if-no-files-found: warn