trigger: none
pr: none
# schedules:
# - cron: 0 16 * * *
#   branches:
#     include: [ master ]

jobs:
- job: linux
  pool: nni-it
  timeoutInMinutes: 120

  steps:
  - template: templates/setup-non-ms-hosted-agent.yml

  - template: templates/config-version.yml
    parameters:
      platform: ubuntu-latest-gpu

  - template: templates/install-dependencies.yml
    parameters:
      platform: ubuntu-latest-gpu

  - template: templates/install-nni.yml

  - script: |
      set -e
      cd examples/tuners/customized_tuner
      python setup.py develop
      nnictl algo register --meta meta_file.yml
    displayName: Install customized tuner

  - script: |
      set -e
      (cd test && python -m pytest ut)
      export PATH=$PATH:$PWD/toolchain/yarn/bin
      export CI=true
      (cd ts/nni_manager && yarn test)
    displayName: SDK unit test

  # TODO: this should be replaced with a dedicated HPO algo test suite

  - script: |
      cd test
      python nni_test/nnitest/run_tests.py --config config/integration_tests.yml --ts local
    displayName: Integration test

# TODO: should add a test on platforms other than linux
