-
Notifications
You must be signed in to change notification settings - Fork 33
104 lines (79 loc) · 2.53 KB
/
ci.yml
File metadata and controls
104 lines (79 loc) · 2.53 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
# Unified CI workflow for SDK generator and all SDKs
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
# ============================================
# Test the Rust SDK Generator
# ============================================
generator:
name: Generator Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
- name: Check formatting
run: cargo fmt --all -- --check
- name: Run Clippy
run: cargo clippy --all --all-targets --all-features -- -D warnings
- name: Run tests
run: cargo test --verbose
# ============================================
# Generate and Test Python SDK
# ============================================
python-sdk:
name: Python SDK
needs: generator
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Generate Python SDK
run: cargo run -- python --latest true
- name: Install dependencies
run: cd xdk/python && uv sync
- name: Run tests
run: cd xdk/python && uv run pytest tests/ -v
# ============================================
# Generate and Test TypeScript SDK
# ============================================
typescript-sdk:
name: TypeScript SDK
needs: generator
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Generate TypeScript SDK
run: cargo run -- typescript --latest true
- name: Install dependencies
run: cd xdk/typescript && npm ci
- name: Build
run: cd xdk/typescript && npm run build
- name: Type check
run: cd xdk/typescript && npm run type-check
- name: Run tests
run: cd xdk/typescript && npm test