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

jobs:
- job: local_windows
  pool: NNI CI WINDOWS2
  timeoutInMinutes: 120

  steps:
  - script: |
      python -m pip install --upgrade pip setuptools wheel
      python -m pip install pytest
    displayName: Install Python tools

  - script: |
      python -m pip uninstall nni --yes
      set NNI_RELEASE=999.0
      python setup.py build_ts
      python setup.py bdist_wheel -p win_amd64
      python -m pip install dist/nni-999.0-py3-none-win_amd64.whl[PPOTuner]
    displayName: Install NNI

  - script: |
      python -m pip install scikit-learn==0.24.1
      python -m pip install keras==2.1.6
      python -m pip install torch==1.6.0 torchvision==0.7.0 -f https://download.pytorch.org/whl/torch_stable.html
      python -m pip install 'pytorch-lightning>=1.1.1,<1.2'
      python -m pip install tensorflow==2.3.1 tensorflow-estimator==2.3.0
    displayName: Install extra dependencies

  # Need del later
  - script: |
      set -e
      python interim_vision_patch.py
    displayName: Vision MNIST Patch

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

  - script: |
      cd test
      python -m pytest ut
      echo "TODO: TypeScript UT"
    displayName: Unit test
    continueOnError: true

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