-
Notifications
You must be signed in to change notification settings - Fork 203
68 lines (65 loc) · 2.54 KB
/
lmql-ci.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
name: Run Tests and Publish Wheel
on:
# on release publish
release:
types: [released]
jobs:
test-without-hf-transformers:
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
- name: Install Dependencies
run: source env/bin/activate && pip install -e . && pip install langchain
- name: Greet
env:
OPENAI_API_KEY: ${{ secrets.LMQL_CI_OPENAI_KEY }}
run: source env/bin/activate && python -m lmql.cli hello openai
test-with-hf-transformers:
runs-on: lmql-ci
needs: [test-without-hf-transformers]
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 Dependencies
run: source env/bin/activate && pip install -e '.[hf,tests]' && pip install langchain
- name: Run Tests
env:
OPENAI_API_KEY: ${{ secrets.LMQL_CI_OPENAI_KEY }}
run: source env/bin/activate && python src/lmql/tests/all.py --failearly
publish:
runs-on: lmql-ci
needs: [test-with-hf-transformers, test-without-hf-transformers]
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: ${{ github.ref }}
run: bash scripts/wheel.sh $(echo $VERSION | sed 's/^refs\/tags\/v//')
- name: Publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
VERSION: ${{ github.ref }}
run: bash scripts/pypi-release.sh lmql-$(echo $VERSION | sed 's/^refs\/tags\/v//') --production