version: '1.0'

steps:

  BuildTorchANI:
    type: build
    description: Build TorchANI
    image_name: torchani
    dockerfile: Dockerfile
    tag: latest

  CodeStyle:
    image: '${{BuildTorchANI}}'
    commands:
      - flake8

  UnitTests:
    image: '${{BuildTorchANI}}'
    commands:
      - find . -name '*.pyc' -delete
      - python setup.py test
      # - python2 setup.py test

  Examples:
    image: '${{BuildTorchANI}}'
    commands:
      - rm -rf *.pt
      - python examples/nnp_training.py dataset/ani_gdb_s01.h5 dataset/ani_gdb_s01.h5
      - python examples/nnp_training.py dataset/ani_gdb_s01.h5 dataset/ani_gdb_s01.h5  # run twice to test if checkpoint is working
      - python examples/training-benchmark.py ./dataset/ani_gdb_s01.h5
      - python examples/training-benchmark.py ./dataset/ani_gdb_s01.h5  # run twice to test if checkpoint is working
      - python examples/energy_force.py
      - python examples/neurochem-test.py ./dataset/ani_gdb_s01.h5

  Docs:
    image: '${{BuildTorchANI}}'
    commands:
      - sphinx-build docs build
