-
Notifications
You must be signed in to change notification settings - Fork 93
55 lines (50 loc) · 1.49 KB
/
python.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
name: Backend
on:
pull_request:
types: [opened, reopened, synchronize]
paths:
- 'lilac/**'
- '**/*.py'
- 'poetry.lock'
- 'poetry.toml'
- 'pyproject.toml'
- 'mypy.ini'
- 'pytest.ini'
- '.python-version'
- '.env'
- '.coveragerc'
- '.github/workflows/python.yml'
- 'scripts/**'
jobs:
build:
name: 'Python lint and test'
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.11']
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
- name: Install dependencies
# Re-install pytorch for cpu to avoid errors that cuda was not found
run: |
./scripts/setup_py.sh
poetry run pip3 install --force-reinstall --pre torch==2.* --index-url https://download.pytorch.org/whl/nightly/cpu
poetry run pip3 install typing_extensions==4.9.0 --force-reinstall
- name: Test CLI
run: |
./integration_tests/run_integration_tests.sh
# We run testing before linting since testing, surprisingly, is much faster.
- name: Test python
run: |
poetry run ./scripts/test_py.sh
- name: Lint python
run: |
poetry run ./scripts/lint_py.sh