# DO NOT CHANGE the "init" and "install" sections below

# Download script file from GitHub
image: previous visual studio 2015
init:
  ps: |
        $ErrorActionPreference = "Stop"
        Invoke-WebRequest http://raw.github.com/krlmlr/r-appveyor/master/scripts/appveyor-tool.ps1 -OutFile "..\appveyor-tool.ps1"
        Import-Module '..\appveyor-tool.ps1'

install:
  - ps: Bootstrap
  - cmd: git submodule update --init --recursive
  - cmd: git clone https://github.com/CxxTest/cxxtest
  - cmd: cd c:\tools\vcpkg
  - cmd: vcpkg integrate install
  - cmd: vcpkg install gsl:x64-windows
  - cmd: vcpkg install fftw3:x64-windows
  - cmd: cd "%APPVEYOR_BUILD_FOLDER%"

cache:
  - C:\RLibrary

# Adapt as necessary starting from here
environment:
  global:
    USE_RTOOLS: true
    NOT_CRAN: true
    _R_CHECK_FORCE_SUGGESTS: false
    _R_CHECK_CRAN_INCOMING_: false
    #R_CHECK_ARGS: "--run-dontrun"
  matrix:

  - R_VERSION: devel
    R_ARCH: x64
    GCC_PATH: gcc-4.6.3


  #- R_VERSION: patched
  #  GCC_PATH: mingw_32

build_script:
  - travis-tool.sh install_deps

test_script:
  - travis-tool.sh run_tests

platform: x64

on_failure:
  - 7z a failure.zip *.Rcheck\*
  - appveyor PushArtifact failure.zip

artifacts:
  - path: '*.Rcheck\**\*.log'
    name: Logs

  - path: '*.Rcheck\**\*.out'
    name: Logs

  - path: '*.Rcheck\**\*.fail'
    name: Logs

  - path: '*.Rcheck\**\*.Rout'
    name: Logs

  - path: '\*_*.tar.gz'
    name: Bits

  - path: '\*_*.zip'
    name: Bits
