azure-pipelines.yml 4.05 KB
Newer Older
Gems Guo's avatar
Gems Guo committed
1
jobs:
chicm-ms's avatar
chicm-ms committed
2
3
4
5
6
7
8
- job: 'basic_test_pr_ubuntu'
  pool:
    vmImage: 'Ubuntu 16.04'
  strategy:
    matrix:
      Python36:
        PYTHON_VERSION: '3.6'
Gems Guo's avatar
Gems Guo committed
9
10

  steps:
11
  - script: python3 -m pip install --upgrade pip setuptools --user
Gems Guo's avatar
Gems Guo committed
12
    displayName: 'Install python tools'
13
14
15
  - script: |
      python3 -m pip install torch==0.4.1 --user
      python3 -m pip install torchvision==0.2.1 --user
chicm-ms's avatar
chicm-ms committed
16
17
      python3 -m pip install tensorflow==1.13.1 --user
    displayName: 'Install dependencies'
Gems Guo's avatar
Gems Guo committed
18
19
20
  - script: |
      source install.sh
    displayName: 'Install nni toolkit via source code'
21
22
  - script: |
      python3 -m pip install flake8 --user
23
      IGNORE=./tools/nni_annotation/testcase/*:F821,./examples/trials/mnist-nas/*/mnist*.py:F821,./examples/trials/nas_cifar10/src/cifar10/general_child.py:F821
24
25
      python3 -m flake8 . --count --per-file-ignores=$IGNORE --select=E9,F63,F72,F82 --show-source --statistics
    displayName: 'Run flake8 tests to find Python syntax errors and undefined names'
26
27
  - script: |
      cd test
28
29
      sudo apt install -y swig
      PATH=$HOME/.local/bin:$PATH nnictl package install --name=SMAC
30
31
      source unittest.sh
    displayName: 'Unit test'
Gems Guo's avatar
Gems Guo committed
32
33
34
  - script: |
      cd test
      PATH=$HOME/.local/bin:$PATH python3 naive_test.py
35
36
37
38
39
    displayName: 'Naive test'
  - script: |
      cd test
      PATH=$HOME/.local/bin:$PATH python3 tuner_test.py
    displayName: 'Built-in tuners / assessors tests'
Gems Guo's avatar
Gems Guo committed
40
41
  - script: |
      cd test
42
43
      PATH=$HOME/.local/bin:$PATH python3 metrics_test.py
    displayName: 'Trial job metrics test'
chicm-ms's avatar
chicm-ms committed
44
45
46
47
  - script: |
      cd test
      PATH=$HOME/.local/bin:$PATH python3 cli_test.py
    displayName: 'nnicli test'
48

chicm-ms's avatar
chicm-ms committed
49
- job: 'basic_test_pr_macOS'
50
51
52
53
54
55
56
57
58
59
  pool:
    vmImage: 'macOS 10.13'
  strategy:
    matrix:
      Python36:
        PYTHON_VERSION: '3.6'

  steps:
  - script: python3 -m pip install --upgrade pip setuptools
    displayName: 'Install python tools'
60
61
62
  - script: |
      python3 -m pip install torch==0.4.1 --user
      python3 -m pip install torchvision==0.2.1 --user
chicm-ms's avatar
chicm-ms committed
63
      python3 -m pip install tensorflow==1.13.1 --user
chicm-ms's avatar
chicm-ms committed
64
    displayName: 'Install dependencies'
65
66
67
  - script: |
      source install.sh
    displayName: 'Install nni toolkit via source code'
68
69
  - script: |
      cd test
70
71
72
73
74
      ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null
      brew install swig@3
      ln -s /usr/local/opt/swig\@3/bin/swig /usr/local/bin/swig
      PATH=$HOME/Library/Python/3.7/bin:$PATH nnictl package install --name=SMAC
      PATH=$HOME/Library/Python/3.7/bin:$PATH source unittest.sh
75
    displayName: 'Unit test'
76
77
78
  - script: |
      cd test
      PATH=$HOME/Library/Python/3.7/bin:$PATH python3 naive_test.py
79
    displayName: 'Naive test'
80
81
  - script: |
      cd test
82
83
      PATH=$HOME/Library/Python/3.7/bin:$PATH python3 tuner_test.py
    displayName: 'Built-in tuners / assessors tests'
chicm-ms's avatar
chicm-ms committed
84
85
86
87
  - script: |
      cd test
      PATH=$HOME/Library/Python/3.7/bin:$PATH python3 cli_test.py
    displayName: 'nnicli test'
chicm-ms's avatar
chicm-ms committed
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
116
117
118
119
120
121
122
123
124
125
126
127

- job: 'basic_test_pr_Windows'
  pool:
    vmImage: 'vs2017-win2016'
  strategy:
    matrix:
      Python36:
        PYTHON_VERSION: '3.6'

  steps:
  - script: |
      powershell.exe -file install.ps1
    displayName: 'Install nni toolkit via source code'
  - script: |
      python -m pip install scikit-learn==0.20.0 --user
      python -m pip install keras==2.1.6 --user
      python -m pip install https://download.pytorch.org/whl/cu90/torch-0.4.1-cp36-cp36m-win_amd64.whl --user
      python -m pip install torchvision --user
      python -m pip install tensorflow==1.13.1 --user
    displayName: 'Install dependencies'
  - script: |
      cd test
      powershell.exe -file unittest.ps1
    displayName: 'unit test'
  - script: |
      cd test
      python naive_test.py
    displayName: 'Naive test'
  - script: |
      cd test
      python tuner_test.py
    displayName: 'Built-in tuners / assessors tests'
  - script: |
      cd test
      python metrics_test.py
    displayName: 'Trial job metrics test'
  - script: |
      cd test
      PATH=$HOME/.local/bin:$PATH python3 cli_test.py
    displayName: 'nnicli test'