-
Notifications
You must be signed in to change notification settings - Fork 11
111 lines (92 loc) · 2.81 KB
/
ci.yml
File metadata and controls
111 lines (92 loc) · 2.81 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
name: CI
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
env:
PYTHON_VERSION: "3.12"
UV_VERSION: "0.8.11"
jobs:
pre-commit:
name: Pre-commit Checks
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12"]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: ${{ env.UV_VERSION }}
- name: Cache uv dependencies
uses: actions/cache@v3
with:
path: |
~/.cache/uv
.venv
key: ${{ matrix.python-version }}-uv-${{ hashFiles('**/uv.lock') }}
restore-keys: |
${{ matrix.python-version }}-uv-
- name: Install dependencies
run: |
uv sync --extra dev
- name: Install pre-commit
run: |
uv run pip install pre-commit
- name: Run pre-commit on all files
run: |
uv run pre-commit run --all-files --show-diff-on-failure
- name: Run pre-commit on staged files (if any)
run: |
uv run pre-commit run --show-diff-on-failure
integration-tests:
name: Tier 2 - Integration Tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12"]
llama-stack-version:
- "main"
- "0.5.0"
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: ${{ env.UV_VERSION }}
- name: Cache uv dependencies
uses: actions/cache@v3
with:
path: |
~/.cache/uv
.venv
key: ${{ matrix.python-version }}-${{ matrix.llama-stack-version }}-uv-${{ hashFiles('**/uv.lock') }}
restore-keys: |
${{ matrix.python-version }}-uv-
- name: Install dependencies
run: |
uv sync --extra dev
- name: Install llama-stack version
run: |
if [ "${{ matrix.llama-stack-version }}" = "main" ]; then
uv pip install "llama-stack @ git+https://github.com/llamastack/llama-stack.git@main"
uv pip install "llama-stack-api @ git+https://github.com/llamastack/llama-stack.git@main#subdirectory=src/llama_stack_api"
else
uv pip install "llama-stack==${{ matrix.llama-stack-version }}"
uv pip install "llama-stack-api==${{ matrix.llama-stack-version }}"
fi
- name: Run integration tests
run: |
uv run pytest -m "lls_integration" -v --tb=short --maxfail=3