-
Notifications
You must be signed in to change notification settings - Fork 165
48 lines (43 loc) · 1.18 KB
/
test-cp310.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
name: test-cp310
on:
pull_request:
branches: ["**"]
permissions:
contents: read
jobs:
test:
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
- name: Checkout examples repo
uses: actions/checkout@v3
with:
repository: leptonai/examples
path: examples
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "pip" # caching pip dependencies
- name: Install dependencies
run: |
pip install -U pip setuptools
- name: Lint
run: |
if ! hash nvidia-smi 2>/dev/null; then
echo "nvidia-smi not found on host, installing cpu version of torch"
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
fi
pip install .[lint]
ruff .
black --check .
- name: Test with pytest
run: |
pip install .
echo "leptonai package version:"
lep -v
lep ph create -n gpt2 -m hf:gpt2
pip install .[runtime] .[test]
cd ..
pytest -x leptonai
cd -