image: hpvm/gitlab-ci
variables:
  GIT_SUBMODULE_STRATEGY: recursive
  # Use a better compressor
  FF_USE_FASTZIP: "true"
  # output upload and download progress every 2 seconds
  TRANSFER_METER_FREQUENCY: "2s"
  # Use no compression for artifacts
  CACHE_COMPRESSION_LEVEL: "fastest"
cache:
  key: "$CI_COMMIT_REF_SLUG"
  paths:
    - hpvm/build/
    - hpvm/llvm/
  when: always

build-and-test:
  stage: build
  tags:
    - hpvm
  script:
    - source activate hpvm && cd hpvm
    - mv /root/cfe-9.0.0.src.tar.xz /root/llvm-9.0.0.src.tar.xz ./
    - mv /root/model_params ./test/dnn_benchmarks
    - ./install.sh -j32 -t "X86" DCMAKE_BUILD_TYPE=Release
    - cd build
    - make -j32 check-hpvm-pass
    - make -j32 check-hpvm-dnn
    - make -j32 check-hpvm-keras-acc
    - make -j32 check-hpvm-torch-acc
    - make -j32 check-hpvm-torch-profiling
    - make -j32 check-hpvm-torch-tuning
  only:
    - hpvm-release-exp
    - merge_requests
