generated from fastai/nbdev_template
-
Notifications
You must be signed in to change notification settings - Fork 278
115 lines (107 loc) · 2.99 KB
/
main.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: CI
on:
workflow_dispatch:
pull_request:
push:
branches:
- master
defaults:
run:
shell: bash
jobs:
fastcore:
strategy:
fail-fast: false
matrix:
os: [ubuntu, macos]#,windows]
py: ["3.8", "3.9", "3.10", "3.11"]
include:
#- os: windows
# shell: "/usr/bin/bash"
- os: ubuntu
shell: "/bin/bash"
- os: macos
shell: "/bin/bash"
runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.py }}
- name: Install dependencies
run: |
pip install -Uqq --pre nbdev
pip install -e ".[dev]"
#- name: Check if notebooks are synced and cleaned
#uses: fastai/workflows/nb@master
- name: Run tests
run: nbdev_test
env:
SHELL: ${{ matrix.shell }}
nbdev-integration-test:
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.9'
- name: clone this branch [fastcore]
uses: actions/checkout@v3
with:
path: fastcore_lib
- name: clone nbdev
uses: actions/checkout@v3
with:
repository: 'fastai/nbdev'
path: nbdev
- name: Install libraries
run: |
cd fastcore_lib && pip install -Ue .[dev]
cd ../nbdev && pip install -Ue .[dev]
- name: test nbdev notebooks
run: |
cd nbdev && nbdev_test
fastai-integration-test:
runs-on: ubuntu-latest
env:
download: "true"
strategy:
matrix:
nb: ['[0-1]', '[2-3]', '[4-5]','[6-7]', '[8-9]']
steps:
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.9'
- name: clone this branch [fastcore]
uses: actions/checkout@v3
with:
path: fastcore/
- name: clone fastai
uses: actions/checkout@v3
with:
repository: 'fastai/fastai'
path: fastai
- name: Install libraries
run: |
pip3 install -Uqq git+https://github.com/fastai/nbdev.git
cd fastai && pip install -Ue ".[dev]"
cd ../fastcore && pip install -Ue .[dev]
- name: check for cache hit
uses: actions/cache@v3
id: cache
with:
path: ~/.fastai/data
key: 'fastai-test-data-v5'
- name: download data
if: env.download == 'true' && steps.cache.outputs.cache-hit != 'true'
run: |
wget https://raw.githubusercontent.com/fastai/docker-containers/master/fastai/tmp_scripts/download_testdata.py
ipython download_testdata.py
mkdir -p $HOME/.fastai/data
find $HOME/.fastai/archive/ -name "*.tgz" -exec tar -xzvf {} -C $HOME/.fastai/data \;
- name: Test fastai notebooks
run: |
cd fastai
nbdev_test --flags '' --n_workers 3 --pause 1.5 --file_re "[0-9]${{matrix.nb}}.*"