diff options
author | tmartins <thigm85@gmail.com> | 2020-06-04 13:35:51 +0200 |
---|---|---|
committer | tmartins <thigm85@gmail.com> | 2020-06-04 13:35:51 +0200 |
commit | ed9aaddf0a70ea749076e0d731233b8456997e1c (patch) | |
tree | 091d084a405d56b5ab5f79772aa3c9c58c6f5200 /.github | |
parent | bb327c878fcfbfd2b0154a5d0983fd1dec29d0e6 (diff) |
include python workflow
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/python.yml | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml new file mode 100644 index 00000000000..17398b6e6af --- /dev/null +++ b/.github/workflows/python.yml @@ -0,0 +1,36 @@ +name: CI +on: [push, pull_request] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-python@v1 + with: + python-version: '3.6' + architecture: 'x64' + - name: Install the library + run: | + pip install nbdev fastcore jupyter pytest + pip install -e . + - name: Test with pytest + run: | + pytest + - name: Read all notebooks + run: | + nbdev_read_nbs + - name: Check if all notebooks are cleaned + run: | + echo "Check we are starting with clean git checkout" + if [ -n "$(git status -uno -s)" ]; then echo "git status is not clean"; false; fi + echo "Trying to strip out notebooks" + nbdev_clean_nbs + echo "Check that strip out was unnecessary" + git status -s # display the status to see which nbs need cleaning up + if [ -n "$(git status -uno -s)" ]; then echo -e "!!! Detected unstripped out notebooks\n!!!Remember to run nbdev_install_git_hooks"; false; fi + - name: Check if there is no diff library/notebooks + run: | + if [ -n "$(nbdev_diff_nbs)" ]; then echo -e "!!! Detected difference between the notebooks and the library"; false; fi + - name: Run tests + run: | + nbdev_test_nbs |