-
Notifications
You must be signed in to change notification settings - Fork 42
52 lines (45 loc) · 1.48 KB
/
ci.yaml
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
name: CI
on:
push:
branches:
- "main"
paths:
- "chatbot/**"
- "tests/**"
- ".github/workflows/**"
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
paths:
- "chatbot/**"
- "tests/**"
- ".github/workflows/**"
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Get poetry version
id: poetry-version
run: echo "poetry-version=$(cat version/poetry)" >> "$GITHUB_OUTPUT"
- name: Install poetry
uses: snok/install-poetry@v1
with:
version: ${{ steps.poetry-version.outputs.poetry-version }}
virtualenvs-in-project: true
- name: Get llama-cpp version
id: llama-cpp-version
run: echo "llama-cpp-version=$(cat version/llama_cpp)" >> "$GITHUB_OUTPUT"
# Installing dependencies and llama-cpp-python without NVIDIA CUDA acceleration.
- name: Setup environment
run: |
poetry lock --check
poetry install --no-root --no-ansi
. .venv/bin/activate && pip3 install llama-cpp-python==${{ steps.llama-cpp-version.outputs.llama-cpp-version }}
- name: Run tests
run: |
poetry run python -m pytest --durations=5 --log-cli-level=DEBUG --capture=tee-sys -v