forked from Lightning-Universe/lightning-flash
-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (61 loc) · 2.34 KB
/
ci-notebook.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
name: CI notebook
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, macOS-10.15, windows-2019]
python-version: [3.8] # 3.6,
env:
TEST_ENV: TRUE
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
# Note: This uses an internal pip API and may not always work
# https://github.com/actions/cache/blob/master/examples.md#multiple-oss-in-a-workflow
- name: Get pip cache
id: pip-cache
run: |
python -c "from pip._internal.locations import USER_CACHE_DIR; print('::set-output name=dir::' + USER_CACHE_DIR)"
- name: Cache pip
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version }}-pip-
- name: Install dependencies
run: |
pip install -U pip wheel
pip install -e .[notebooks,image,tabular,text] --upgrade --find-links https://download.pytorch.org/whl/cpu/torch_stable.html
- name: Cache datasets
uses: actions/cache@v2
with:
path: flash_examples/finetuning # This path is specific to Ubuntu
# Look to see if there is a cache hit for the corresponding requirements file
key: flash-datasets_finetuning
- name: Cache datasets
uses: actions/cache@v2
with:
path: flash_examples/predict # This path is specific to Ubuntu
# Look to see if there is a cache hit for the corresponding requirements file
key: flash-datasets_predict
- name: Run Notebooks
env:
FIFTYONE_DO_NOT_TRACK: true
FLASH_TESTING: 1
run: |
jupyter nbconvert --to script flash_notebooks/image_classification.ipynb
jupyter nbconvert --to script flash_notebooks/tabular_classification.ipynb
jupyter nbconvert --to script flash_notebooks/text_classification.ipynb
ipython flash_notebooks/image_classification.py
ipython flash_notebooks/tabular_classification.py
ipython flash_notebooks/text_classification.py