nni/pipelines/fast-test.yml

256 строки
6.9 KiB
YAML
Исходник Обычный вид История

trigger: none
2022-06-16 03:27:41 +03:00
schedules:
- cron: 0 16 * * *
branches:
include: [ master ]
always: true
2022-06-16 03:27:41 +03:00
2022-06-13 03:33:55 +03:00
variables:
filter.modified.globs: 'pipelines/fast-test.yml,!.github/**,!docs/**,!examples/**'
2022-06-13 03:33:55 +03:00
filter.prbody.heading: '#### Test Options'
filter.prbody.optionIndex: 0
stages:
- stage: lint
jobs:
2022-05-06 14:01:09 +03:00
- job: copyright
pool:
vmImage: ubuntu-latest
steps:
- script: python test/vso_tools/copyright_check.py
displayName: Check copyright header
- job: docs
pool:
vmImage: ubuntu-latest
steps:
- template: templates/install-dependencies.yml
parameters:
platform: ubuntu-latest
- script: |
cd docs
2022-04-01 12:31:16 +03:00
rstcheck -r source \
--ignore-directives automodule,autoclass,autofunction,cardlinkitem,codesnippetcard,argparse,tabs,youtube,image-sg \
2022-04-01 12:31:16 +03:00
--ignore-roles githublink --ignore-substitutions release \
--report-level warning
2022-04-01 12:31:16 +03:00
displayName: rstcheck
- script: |
cd docs
2022-05-20 11:53:58 +03:00
sphinx-build -W --keep-going -T -q source build/html
displayName: Sphinx sanity check
- script: |
set -e
cd docs
sudo apt-get install -y gettext
python tools/translation_patch.py
2022-05-20 11:53:58 +03:00
sphinx-build -W --keep-going -T -q -D language=zh source build/html_zh
displayName: Sphinx sanity check (Chinese)
- script: |
set -e
cd docs
make i18n
git diff --exit-code source/locales
displayName: Translation up-to-date
2022-04-14 09:55:56 +03:00
- script: |
cd docs
2022-05-20 11:53:58 +03:00
sphinx-build -b linkcheck -W --keep-going -T -q source build/linkcheck
2022-04-14 09:55:56 +03:00
displayName: External links integrity check
- job: python
pool:
vmImage: ubuntu-latest
steps:
- template: templates/install-dependencies.yml
parameters:
platform: ubuntu-latest
- script: |
# pylint requires newer typing extension. Override requirements in tensorflow
python -m pip install "typing-extensions>=3.10"
displayName: Resolve dependency version
- script: python test/vso_tools/trigger_import.py
displayName: Trigger import
- script: |
python -m pylint --rcfile pylintrc nni
displayName: pylint
- 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
2022-03-24 18:37:05 +03:00
- script: |
python -m pyright nni
2022-03-25 12:13:22 +03:00
displayName: Type Check
2022-03-24 18:37:05 +03:00
- job: typescript
pool:
vmImage: ubuntu-latest
steps:
- template: templates/install-dependencies.yml
parameters:
platform: ubuntu-latest
- script: |
set -e
2022-11-16 05:37:48 +03:00
npm --prefix ts/nni_manager install
npm --prefix ts/nni_manager run eslint
displayName: ESLint (NNI Manager)
- script: |
set -e
yarn --cwd ts/webui
2022-02-10 07:55:46 +03:00
yarn --cwd ts/webui sanity-check
displayName: Sanity check (WebUI)
2022-06-13 03:33:55 +03:00
- stage: filter
jobs:
- job: check
pool:
vmImage: ubuntu-latest
steps:
- template: templates/stage-filter.yml
# 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.
- stage: test
2022-06-13 03:33:55 +03:00
dependsOn: lint
# dependencies.$(StageName).outputs['$(JobName).$(TaskName).$(VariableName)']
condition: and(succeeded(), ne(dependencies.filter.outputs['check.execution.skipsubsequent'], 'true'))
jobs:
- job: ubuntu_latest
pool:
vmImage: ubuntu-latest
steps:
- template: templates/install-dependencies.yml
parameters:
platform: ubuntu-latest
- template: templates/install-nni.yml
- script: |
set -e
mkdir -p coverage
cd test
python -m pytest ut --cov-config=.coveragerc
cp coverage.xml ../coverage/python.xml
displayName: Python unit test
- script: |
2022-11-16 05:37:48 +03:00
set -e
npm --prefix ts/nni_manager run test
cp ts/nni_manager/coverage/cobertura-coverage.xml coverage/typescript.xml
displayName: TypeScript unit test
- 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
summaryFileLocation: coverage/*
displayName: Publish code coverage results
- script: |
cd test
python training_service/nnitest/run_tests.py --config training_service/config/pr_tests.yml
displayName: Simple integration test
- job: ubuntu_legacy
pool:
vmImage: ubuntu-18.04
steps:
- template: templates/install-dependencies.yml
parameters:
platform: ubuntu-legacy
- template: templates/install-nni.yml
- script: |
cd test
python training_service/nnitest/run_tests.py --config training_service/config/pr_tests.yml
displayName: Simple integration test
- script: |
cd test
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
displayName: Python unit test
- script: |
export PATH=${PWD}/toolchain/node/bin:$PATH
2022-11-16 05:37:48 +03:00
npm --prefix ts/nni_manager run test
displayName: TypeScript unit test
- job: windows
pool:
vmImage: windows-latest
2022-02-28 08:59:49 +03:00
timeoutInMinutes: 75
steps:
- template: templates/install-dependencies.yml
parameters:
platform: windows
- template: templates/install-nni.yml
parameters:
user: false
- script: |
cd test
python -m pytest ut
displayName: Python unit test
# temporarily disable this test, add it back after bug fixed
# - script: |
# npm --prefix ts/nni_manager run test
# displayName: TypeScript unit test
- script: |
cd test
python training_service/nnitest/run_tests.py --config training_service/config/pr_tests.yml
displayName: Simple integration test
- job: macos
pool:
vmImage: macOS-latest
steps:
- template: templates/install-dependencies.yml
parameters:
platform: macos
- template: templates/install-nni.yml
- script: |
2022-11-16 05:37:48 +03:00
CI=true npm --prefix ts/nni_manager run test --exclude test/core/nnimanager.test.ts
displayName: TypeScript unit test
2021-12-14 06:28:56 +03:00
- script: |
cd test
python -m pytest ut
displayName: Python unit test
- script: |
cd test
python training_service/nnitest/run_tests.py --config training_service/config/pr_tests.yml
displayName: Simple integration test