-
Notifications
You must be signed in to change notification settings - Fork 203
102 lines (96 loc) · 3.04 KB
/
lmql-tests.yml
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: Run Tests
on:
push:
branches: [ main ]
jobs:
tests:
runs-on: lmql-ci
steps:
- uses: actions/checkout@v3
- name: Setup Fresh Virtual Environment
run: |
pip install --upgrade pip
python3.10 -m venv env
export PATH=$PATH:/home/docker/.local/bin
source env/bin/activate
echo "VIRTUAL ENV:" $VIRTUAL_ENV
# cache dependencies
- name: Cache dependencies
id: cache
uses: corca-ai/local-cache@v2
with:
path: env
key: ${{ runner.os }}-env-${{ hashFiles('**/setup.cfg') }}
base: "/home/docker/.cache/"
- name: Install Dependencies
run: source env/bin/activate && pip install -e '.[hf,hf-accel,tests,llama]'
- name: Run Default Tests
run: source env/bin/activate && python src/lmql/tests/all.py --failearly
wheel:
runs-on: lmql-ci
needs: [tests]
steps:
- uses: actions/checkout@v3
- name: Setup Fresh Virtual Environment
run: |
pip install --upgrade pip
python3.10 -m venv env
export PATH=$PATH:/home/docker/.local/bin
source env/bin/activate
echo "VIRTUAL ENV:" $VIRTUAL_ENV
- name: Install Packaging Dependencies
run: pip install build twine
- name: Package
env:
VERSION: 0.999999
run: bash scripts/wheel.sh $VERSION
- name: Upload wheel as artifact
uses: actions/upload-artifact@v2
with:
name: lmql
path: dist/
web-build:
runs-on: ubuntu-latest
needs: [tests]
steps:
- uses: actions/checkout@v3
- name: Prepare Node.js environment
uses: actions/setup-node@v3
with:
node-version: 20.x
cache: 'npm'
# cached dependencies for node
- name: Cache node modules
uses: actions/cache@v3
with:
path: |
docs/node_modules
scripts/browser-build/node_modules
src/lmql/ui/live/node_modules
src/lmql/ui/playground/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
- name: Build website and In-Browser LMQL Distribution
run: cd scripts && bash deploy-web.sh
- uses: actions/upload-artifact@master
with:
name: lmql-web-payload
path: web-deploy
web-deploy:
name: Deploy Main Playground
runs-on: ubuntu-latest
needs: [web-build]
if:
contains('
refs/heads/main
', github.ref)
steps:
- uses: actions/checkout@master
- uses: actions/download-artifact@master
with:
name: lmql-web-payload
path: web-deploy
- name: Deploy to web branch
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: web-deploy
branch: web