-
Notifications
You must be signed in to change notification settings - Fork 22
102 lines (95 loc) · 2.94 KB
/
Copy pathcontract-tests.yml
File metadata and controls
102 lines (95 loc) · 2.94 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
name: Contract tests
# Issue #37 phase 3 (#47): enforce, on every PR, that the CLI's API calls and
# the Python SDK's consumed models stay aligned with the website-mirrored
# public OpenAPI contract. The cli/python *-publish workflows only run on
# release tags, so without this the contract guards would not gate PRs.
on:
pull_request:
paths:
- "docs/openapi/**"
- "packages/cli/src/**"
- "packages/cli/test/openapi-contract.test.mjs"
- "packages/python-sdk/qveris/**"
- "packages/python-sdk/tests/test_openapi_contract.py"
- "packages/js-sdk/src/**"
- "packages/mcp/src/**"
- "packages/mcp/package.json"
- "packages/mcp/package-lock.json"
- "packages/mcp/tsconfig.json"
- ".github/workflows/contract-tests.yml"
push:
branches:
- main
paths:
- "docs/openapi/**"
- "packages/cli/src/**"
- "packages/cli/test/openapi-contract.test.mjs"
- "packages/python-sdk/qveris/**"
- "packages/python-sdk/tests/test_openapi_contract.py"
- "packages/js-sdk/src/**"
- "packages/mcp/src/**"
- "packages/mcp/package.json"
- "packages/mcp/package-lock.json"
- "packages/mcp/tsconfig.json"
- ".github/workflows/contract-tests.yml"
permissions:
contents: read
jobs:
cli-contract:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: CLI ↔ OpenAPI contract test
working-directory: packages/cli
run: node --test test/openapi-contract.test.mjs
python-contract:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Python SDK ↔ generated-contract test
working-directory: packages/python-sdk
run: |
python -m pip install --quiet pytest "pydantic>=2.0.0"
PYTHONPATH=. python -m pytest tests/test_openapi_contract.py -q
js-sdk-tests:
runs-on: ubuntu-latest
defaults:
run:
working-directory: packages/js-sdk
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
cache-dependency-path: packages/js-sdk/package-lock.json
- name: Install dependencies
run: npm ci
- name: Type check
run: npm run typecheck
- name: JS SDK client tests
run: npm test
mcp-tests:
runs-on: ubuntu-latest
defaults:
run:
working-directory: packages/mcp
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
cache-dependency-path: packages/mcp/package-lock.json
- name: Install dependencies
run: npm ci
- name: Type check
run: npm run typecheck
- name: MCP server tests
run: npm test