-
Notifications
You must be signed in to change notification settings - Fork 2
67 lines (54 loc) · 2.04 KB
/
Copy pathtest.yml
File metadata and controls
67 lines (54 loc) · 2.04 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
name: Lint and Test
on:
pull_request:
branches: [main, "feat/**", "fix/**"]
push:
branches: [main]
jobs:
lint-and-test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12"]
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0
with:
version: "0.6.14"
enable-cache: true
- name: Install dependencies
run: uv sync --dev --all-extras
- name: Create test env
run: cp tests/sample.env tests/.env
- name: Lint (ruff)
run: uv run ruff check src/
- name: Tests (pytest)
run: uv run pytest tests/ -v
sdk-drift:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: "3.12"
- name: Install uv
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0
with:
version: "0.6.14"
enable-cache: true
# The generated tree is committed, so an edit to it reviews like any
# other change and then disappears on the next regeneration. Same for a
# spec change that never had the generator run over it.
- name: Regenerate from the committed spec
run: ./tools/gen_sdk.sh
# `git add -N` first: a diff alone cannot see a file the generator has
# newly created, which is exactly what a spec growing an endpoint does.
- name: Fail if the committed SDK is not what the spec generates
run: |
git add -N -- src/unstract/api_deployments/_sdk_docstudio
git diff --exit-code -- src/unstract/api_deployments/_sdk_docstudio