-
Notifications
You must be signed in to change notification settings - Fork 9
164 lines (152 loc) · 5.2 KB
/
Copy pathci.yml
File metadata and controls
164 lines (152 loc) · 5.2 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: "17 6 * * 1"
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo test --all-features
- name: Verify checked-in conformance reports
run: |
CONFORMANCE_REPORT=1 cargo test --test conformance --test conformance_json_schema
git diff --exit-code -- tests/conformance/coverage-report.md tests/conformance/json-schema-2020-12-report.md
openai-sdk-compat:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: |
. -> target
examples/server-openai-responses -> target
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
cache-dependency-path: tests/python/openai_sdk_compat/requirements.txt
- name: Install pinned official OpenAI Python SDK
run: python -m pip install --requirement tests/python/openai_sdk_compat/requirements.txt
- name: Test official SDK against generated Axum server
env:
OPENAI_COMPAT_PYTHON: python
run: >-
cargo test --test openai_sdk_compat_test
official_openai_python_sdk_matches_generated_axum_server --
--ignored --exact --nocapture
anthropic-sdk-compat:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: |
. -> target
examples/server-anthropic-messages -> target
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
cache-dependency-path: tests/python/anthropic_sdk_compat/requirements.txt
- name: Install pinned official Anthropic Python SDK
run: python -m pip install --requirement tests/python/anthropic_sdk_compat/requirements.txt
- name: Test official SDK against generated Axum server
env:
ANTHROPIC_COMPAT_PYTHON: python
run: >-
cargo test --test anthropic_sdk_compat_test
official_anthropic_python_sdk_matches_generated_axum_server --
--ignored --exact --nocapture
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --all-features -- -D warnings
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --check
doc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo doc --no-deps --all-features
env:
RUSTDOCFLAGS: -D warnings
install-smoke:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: scripts/install-smoke.sh
env:
# Keep cargo-install artifacts inside the target tree restored by
# rust-cache; the script still isolates and removes its package root.
CARGO_TARGET_DIR: ${{ github.workspace }}/target/install-smoke
msrv:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.88.0
- uses: Swatinem/rust-cache@v2
- run: cargo check --all-targets --all-features
# Fast tier: every supported corpus document must generate, while the two
# production-target specs must also compile from their exact dependency
# fragments. The full compile tier runs separately on a schedule/manual run.
spec-compile:
if: github.event_name != 'schedule' && github.event_name != 'workflow_dispatch'
runs-on: ubuntu-latest
env:
# Share scratch-crate dependencies across runs through rust-cache's
# root-workspace target directory.
SPEC_COMPILE_TARGET_DIR: ${{ github.workspace }}/target/spec-compile
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: SPEC_COMPILE_PARSE_ONLY=1 scripts/spec-compile.sh
- run: scripts/spec-compile.sh anthropic openai
full-spec-compile:
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
timeout-minutes: 240
env:
SPEC_COMPILE_TARGET_DIR: ${{ github.workspace }}/target/spec-compile
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: scripts/spec-compile.sh