-
-
Notifications
You must be signed in to change notification settings - Fork 22
96 lines (77 loc) · 2.51 KB
/
pr-tests.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
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
name: Run tests on pull requests
on:
pull_request:
branches: [main]
push:
branches: [main]
env:
OPENAI_API_KEY: dummy_key
jobs:
run-tests:
runs-on: ubuntu-latest
name: Run test suite (Python ${{ matrix.python-version }})
strategy:
matrix:
python-version: [3.11, 3.12]
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Update apt and install curl
run: |
sudo apt-get update
sudo apt-get install -y curl
- name: Download Ollama installation script
run: curl -fsSL https://ollama.com/install.sh -o install.sh
- name: Run Ollama installation script
run: bash install.sh
- name: Setup Pixi Environment
uses: prefix-dev/[email protected]
with:
pixi-version: latest
cache: true
cache-write: ${{ github.event_name == 'push' }}
- name: Run tests (pixi)
run: |
pixi run test
# https://github.com/codecov/codecov-action
- name: Upload code coverage
uses: codecov/codecov-action@v4
with:
# fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)
smoke-tests:
runs-on: ubuntu-latest
name: Run smoke tests (Python ${{ matrix.python-version }})
strategy:
matrix:
python-version: [3.11, 3.12]
environment-type: ['pixi', 'bare']
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Pixi Environment
uses: prefix-dev/[email protected]
if: ${{ matrix.environment-type == 'pixi' }}
with:
pixi-version: latest
cache: true
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
- name: Setup uv
# Install latest uv version using the installer
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Set up Python
run: uv venv llamabot-env --python ${{ matrix.python-version }}
if: ${{ matrix.environment-type == 'bare' }}
- name: Test CLI (pixi)
if: matrix.environment-type == 'pixi' && github.repository_owner == 'ericmjl'
run: |
pixi run llamabot-cli
- name: Test CLI (bare)
if: matrix.environment-type == 'bare' && github.repository_owner == 'ericmjl'
run: |
source llamabot-env/bin/activate
uv pip install .
llamabot --help