Skip to content

Commit f257cba

Browse files
authored
Merge branch 'main' into readme/banner
2 parents ee77be4 + 0be9183 commit f257cba

File tree

3 files changed

+54
-11
lines changed

3 files changed

+54
-11
lines changed

.github/workflows/ci-cloud.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Cloud integration
2+
3+
# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows
4+
on: [push, workflow_dispatch]
5+
6+
defaults:
7+
run:
8+
shell: bash
9+
10+
jobs:
11+
integration:
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
os: ["ubuntu-22.04", "macOS-13", "windows-2022"]
17+
python-version: ["3.10"]
18+
19+
# Timeout: https://stackoverflow.com/a/59076067/4521646
20+
timeout-minutes: 15
21+
env:
22+
TORCH_URL: "https://download.pytorch.org/whl/cpu/torch_stable.html"
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
- uses: actions/setup-python@v5
27+
with:
28+
python-version: ${{ matrix.python-version }}
29+
cache: "pip"
30+
31+
- name: Install package & dependencies
32+
run: |
33+
pip --version
34+
pip install -e '.[test,extra]' -U -q --find-links $TORCH_URL
35+
pip list
36+
37+
- name: Test integrations
38+
env:
39+
LIGHTNING_USER_ID: ${{ secrets.LIGHTNING_USER_ID }}
40+
LIGHTNING_API_KEY: ${{ secrets.LIGHTNING_API_KEY }}
41+
run: |
42+
coverage run --source litmodels -m pytest src tests -v -m cloud
43+
timeout-minutes: 5

.github/workflows/ci-testing.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: CI testing
33
# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows
44
on: # Trigger the workflow on push or pull request, but only for the main branch
55
push: {}
6-
pull_request_target:
6+
pull_request:
77
branches: [main]
88

99
defaults:
@@ -51,14 +51,6 @@ jobs:
5151
run: |
5252
coverage run --source litmodels -m pytest src tests -v -m "not cloud"
5353
54-
- name: Test integrations
55-
env:
56-
LIGHTNING_USER_ID: ${{ secrets.LIGHTNING_USER_ID }}
57-
LIGHTNING_API_KEY: ${{ secrets.LIGHTNING_API_KEY }}
58-
run: |
59-
coverage run --source litmodels -m pytest src tests -v -m cloud
60-
timeout-minutes: 5
61-
6254
- name: Statistics
6355
run: |
6456
coverage report

tests/test_io_cloud.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,18 @@
99
from torch.nn import Module
1010

1111

12-
@pytest.mark.parametrize("name", ["org/model", "model-name", "/too/many/slashes"])
13-
def test_wrong_model_name(name):
12+
@pytest.mark.parametrize(
13+
"name", ["/too/many/slashes", "org/model"]
14+
) # todo: add back "model-name" after next SDk release
15+
def test_upload_wrong_model_name(name):
1416
with pytest.raises(ValueError, match=r".*organization/teamspace/model.*"):
1517
upload_model_files(path="path/to/checkpoint", name=name)
18+
19+
20+
@pytest.mark.parametrize(
21+
"name", ["/too/many/slashes", "org/model"]
22+
) # todo: add back "model-name" after next SDk release
23+
def test_download_wrong_model_name(name):
1624
with pytest.raises(ValueError, match=r".*organization/teamspace/model.*"):
1725
download_model(name=name)
1826

0 commit comments

Comments
 (0)