"src/include/rtg/erase.hpp" did not exist on "91570d04fd475a24b9cb109bf54a114479e0967d"
fast-test.yml 7.39 KB
Newer Older
1
trigger: none
2

J-shang's avatar
J-shang committed
3
4
5
6
7
8
9
10
11
12
13
14
resources:
  repositories:
    - repository: azpfilter
      type: github
      name: microsoft/azure-pipeline-filter
      endpoint: github-filter-connection

variables:
  filter.modified.globs: '!.github/**,!docs/**,!examples/**'
  filter.prbody.heading: '#### Test Options'
  filter.prbody.optionIndex: 0

15
16
17
stages:
- stage: lint
  jobs:
Yuge Zhang's avatar
Yuge Zhang committed
18
19
20
21
22
23
24
25

  - job: copyright
    pool:
      vmImage: ubuntu-latest
    steps:
    - script: python test/vso_tools/copyright_check.py
      displayName: Check copyright header

26
27
28
29
  - job: docs
    pool:
      vmImage: ubuntu-latest
    steps:
30
31
32
33
    - template: templates/install-dependencies.yml
      parameters:
        platform: ubuntu-latest

34
35
    - script: |
        cd docs
Yuge Zhang's avatar
Yuge Zhang committed
36
        rstcheck -r source \
37
          --ignore-directives automodule,autoclass,autofunction,cardlinkitem,codesnippetcard,argparse,tabs,youtube \
Yuge Zhang's avatar
Yuge Zhang committed
38
          --ignore-roles githublink --ignore-substitutions release \
39
          --report-level warning
Yuge Zhang's avatar
Yuge Zhang committed
40
      displayName: rstcheck
41
42
43

    - script: |
        cd docs
liuzhe-lz's avatar
liuzhe-lz committed
44
        sphinx-build -W --keep-going -T -q source build/html
45
      displayName: Sphinx sanity check
46

47
    - script: |
48
        set -e
49
        cd docs
50
51
        sudo apt-get install -y gettext
        python tools/translation_patch.py
liuzhe-lz's avatar
liuzhe-lz committed
52
        sphinx-build -W --keep-going -T -q -D language=zh source build/html_zh
53
54
55
      displayName: Sphinx sanity check (Chinese)

    - script: |
56
        set -e
57
        cd docs
58
59
        make i18n
        git diff --exit-code source/locales
60
      displayName: Translation up-to-date
61

Yuge Zhang's avatar
Yuge Zhang committed
62
63
    - script: |
        cd docs
liuzhe-lz's avatar
liuzhe-lz committed
64
        sphinx-build -b linkcheck -W --keep-going -T -q source build/linkcheck
Yuge Zhang's avatar
Yuge Zhang committed
65
66
      displayName: External links integrity check

67
68
69
70
  - job: python
    pool:
      vmImage: ubuntu-latest
    steps:
71
72
73
74
    - template: templates/install-dependencies.yml
      parameters:
        platform: ubuntu-latest

75
    - script: |
76
77
78
79
        # pylint requires newer typing extension. Override requirements in tensorflow
        python -m pip install "typing-extensions>=3.10"
      displayName: Resolve dependency version

80
81
82
    - script: python test/vso_tools/trigger_import.py
      displayName: Trigger import

83
    - script: |
84
        python -m pylint --rcfile pylintrc nni
85
      displayName: pylint
86

87
88
89
90
91
92
93
    - script: |
        set -e
        python -m flake8 nni --count --select=E9,F63,F72,F82 --show-source --statistics
        EXCLUDES=examples/trials/mnist-nas/*/mnist*.py,examples/trials/nas_cifar10/src/cifar10/general_child.py
        python -m flake8 examples --count --exclude=$EXCLUDES --select=E9,F63,F72,F82 --show-source --statistics
      displayName: flake8

94
95
    - script: |
        python -m pyright nni
liuzhe-lz's avatar
liuzhe-lz committed
96
      displayName: Type Check
97

98
99
100
101
  - job: typescript
    pool:
      vmImage: ubuntu-latest
    steps:
102
103
104
105
    - template: templates/install-dependencies.yml
      parameters:
        platform: ubuntu-latest

106
107
    - script: |
        set -e
108
109
        yarn --cwd ts/nni_manager
        yarn --cwd ts/nni_manager eslint
110
      displayName: ESLint (NNI Manager)
111

112
113
    - script: |
        set -e
114
        yarn --cwd ts/webui
115
116
        yarn --cwd ts/webui sanity-check
      displayName: Sanity check (WebUI)
117

J-shang's avatar
J-shang committed
118
119
120
121
122
123
124
- stage: filter
  jobs:
  - job: check
    pool:
      vmImage: ubuntu-latest
    steps:
    - template: templates/stage-filter.yml
125

126
127
  # To reduce debug cost, steps are sorted differently on each platform,
  # so that a bug in any module will cause at least one platform to fail quickly.
128
- stage: test
J-shang's avatar
J-shang committed
129
130
131
  dependsOn: lint
  # dependencies.$(StageName).outputs['$(JobName).$(TaskName).$(VariableName)']
  condition: and(succeeded(), ne(dependencies.filter.outputs['check.execution.skipsubsequent'], 'true'))
132
133
134
135
136
137
  jobs:
  - job: ubuntu_latest
    pool:
      vmImage: ubuntu-latest

    steps:
138
139
140
    - template: templates/install-dependencies.yml
      parameters:
        platform: ubuntu-latest
141

142
    - template: templates/install-nni.yml
143
144
145

    - script: |
        set -e
146
        mkdir -p coverage
147
        cd test
148
        python -m pytest ut --cov-config=.coveragerc \
149
150
151
152
153
154
155
156
          --ignore=ut/compression/v1/test_pruners.py \
          --ignore=ut/compression/v1/test_compressor_tf.py \
          --ignore=ut/compression/v1/test_compressor_torch.py \
          --ignore=ut/compression/v1/test_model_speedup.py
        python -m pytest ut/compression/v1/test_pruners.py --cov-config=.coveragerc --cov-append
        python -m pytest ut/compression/v1/test_compressor_tf.py --cov-config=.coveragerc --cov-append
        python -m pytest ut/compression/v1/test_compressor_torch.py --cov-config=.coveragerc --cov-append
        python -m pytest ut/compression/v1/test_model_speedup.py --cov-config=.coveragerc --cov-append
157
        cp coverage.xml ../coverage/python.xml
158
159
160
      displayName: Python unit test

    - script: |
161
162
        yarn --cwd ts/nni_manager test
        cp ts/nni_manager/coverage/cobertura-coverage.xml coverage/typescript.xml
163
164
      displayName: TypeScript unit test

165
166
167
168
169
170
171
172
173
174
    - task: PublishTestResults@2
      condition: succeededOrFailed()
      inputs:
        testResultsFiles: '$(System.DefaultWorkingDirectory)/**/test-*.xml'
        testRunTitle: 'Publish test results for Python $(python.version)'
      displayName: Publish test results

    - task: PublishCodeCoverageResults@1
      inputs:
        codeCoverageTool: Cobertura
175
        summaryFileLocation: coverage/*
176
177
      displayName: Publish code coverage results

178
179
    - script: |
        cd test
180
        python training_service/nnitest/run_tests.py --config training_service/config/pr_tests.yml
181
182
183
184
185
186
187
      displayName: Simple integration test

  - job: ubuntu_legacy
    pool:
      vmImage: ubuntu-18.04

    steps:
188
189
190
    - template: templates/install-dependencies.yml
      parameters:
        platform: ubuntu-legacy
191

192
    - template: templates/install-nni.yml
193
194
195

    - script: |
        cd test
196
        python training_service/nnitest/run_tests.py --config training_service/config/pr_tests.yml
197
198
199
200
      displayName: Simple integration test

    - script: |
        cd test
201
202
203
        python -m pytest ut --ignore=ut/retiarii/test_convert_basic.py \
          --ignore=ut/retiarii/test_convert_operators.py \
          --ignore=ut/retiarii/test_convert_pytorch.py
204
205
206
      displayName: Python unit test

    - script: |
207
        yarn --cwd ts/nni_manager test
208
209
      displayName: TypeScript unit test

210
  - job: windows
211
    pool:
212
      vmImage: windows-latest
213
    timeoutInMinutes: 75
214
215

    steps:
216
217
218
    - template: templates/install-dependencies.yml
      parameters:
        platform: windows
219

220
221
222
    - template: templates/install-nni.yml
      parameters:
        user: false
223
224
225
226
227
228

    - script: |
        cd test
        python -m pytest ut
      displayName: Python unit test

229
230
231
232
    - script: |
        yarn --cwd ts/nni_manager test
      displayName: TypeScript unit test

233
234
    - script: |
        cd test
235
        python training_service/nnitest/run_tests.py --config training_service/config/pr_tests.yml
236
237
      displayName: Simple integration test

238
  - job: macos
239
    pool:
240
      vmImage: macOS-latest
241
242

    steps:
243
244
245
    - template: templates/install-dependencies.yml
      parameters:
        platform: macos
246

247
    - template: templates/install-nni.yml
248
249

    - script: |
250
251
        CI=true yarn --cwd ts/nni_manager test --exclude test/core/nnimanager.test.ts
      displayName: TypeScript unit test
J-shang's avatar
J-shang committed
252

253
254
255
256
257
258
259
    - script: |
        cd test
        python -m pytest ut
      displayName: Python unit test

    - script: |
        cd test
260
        python training_service/nnitest/run_tests.py --config training_service/config/pr_tests.yml
261
      displayName: Simple integration test