-
Notifications
You must be signed in to change notification settings - Fork 351
/
azure-pipelines.yml
74 lines (60 loc) · 2.8 KB
/
azure-pipelines.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
# Python package
# Create and test a Python package on multiple Python versions.
# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more:
# https://docs.microsoft.com/en-us/azure/devops/pipelines/languages/python?view=vsts
# Capabilities and limitations:
# https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=vsts&tabs=yaml#capabilities-and-limitations
# - Provide at least 10 GB of storage for your source and build outputs.
# - Can run jobs for up to 360 minutes (6 hours).
# Notes on pipeline definitions:
#
# the number after @ in task definition indicates the azure internal version of the specific task, e.g:
# - task: CondaEnvironment@1
# means use azure's CondaEnvironment's version 1, so need to check the docs for each specific task's desired (usually latest) version. If later 1.2 is released then use:
# - task: [email protected]
# instead
#
# job name must match r'\w+' (no '-', but '_' ok)
#
# Build environments: Available vmImage values: 'Ubuntu-16.04', 'macOS-10.13', 'VS2017-Win2016'
#
jobs:
##################
### nbstripout ###
##################
- job: 'nbstripout_config'
pool:
vmImage: 'Ubuntu-16.04'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.6'
architecture: 'x64'
# Install nbformat
- script: |
pip install nbformat ipykernel notebook matplotlib pandas requests pyyaml fastprogress pillow scipy numpy typeguard
pip install git+https://github.com/fastai/nbdev.git
displayName: 'Install nbformat'
continueOnError: false
# check that notebooks are stripped out. if they aren't that means the committer doesn't have the correct configuration for the stripout filter.
- script: |
echo "Trying to load all notebooks"
tools/read-nbs
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"
tools/fastai-nbstripout -d dev_nb/*ipynb dev_nb/*/*ipynb dev_course/*/*ipynb
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 tools/run-after-git-clone"; false; fi
displayName: 'Detect unstripped out notebook commits'
failOnStderr: true
continueOnError: false
# check that there is no diff notebooks/module.
- script: |
echo "Diff nbs/module"
pushd dev
if [ -n "$(tools/diff_nb_script)" ]; then echo -e "!!! Diff between nbs and scripts\n!!!Remember to run notebook2script.py or script2notebook.py"; false; fi
displayName: 'Detect diff module/nbs'
failOnStderr: true
continueOnError: false