-
Notifications
You must be signed in to change notification settings - Fork 21
63 lines (55 loc) · 1.85 KB
/
test.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: CI
on: [workflow_dispatch, pull_request, push]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Activate conda env with environment.yml
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment.yml
cache-environment: true
post-cleanup: 'all'
- name: Install nbdev
shell: bash -l {0}
run: |
pip install -U nbdev
- name: Doing editable install
shell: bash -l {0}
run: |
test -f setup.py && pip install -e ".[dev]"
- name: Check we are starting with clean git checkout
shell: bash -l {0}
run: |
if [[ `git status --porcelain -uno` ]]; then
git diff
echo "git status is not clean"
false
fi
- name: Trying to strip out notebooks
shell: bash -l {0}
run: |
nbdev_clean
git status -s # display the status to see which nbs need cleaning up
if [[ `git status --porcelain -uno` ]]; then
git status -uno
echo -e "!!! Detected unstripped out notebooks\n!!!Remember to run nbdev_install_hooks"
echo -e "This error can also happen if you are using an older version of nbdev relative to what is in CI. Please try to upgrade nbdev with the command `pip install -U nbdev`"
false
fi
- name: Run nbdev_export
shell: bash -l {0}
run: |
nbdev_export
if [[ `git status --porcelain -uno` ]]; then
echo "::error::Notebooks and library are not in sync. Please run nbdev_export."
git status -uno
git diff
exit 1;
fi
- name: Run nbdev_test
shell: bash -l {0}
run: |
nbdev_test