environment:
  matrix:
  - TARGET: unittests
    MACHINE_TYPE: "x86"
    PYTHON: "C:\\Python38"
    PYTHON_VERSION: "3.8"
    L2TBINARIES_TRACK: "dev"
  - TARGET: unittests
    MACHINE_TYPE: "amd64"
    PYTHON: "C:\\Python38-x64"
    PYTHON_VERSION: "3.8"
    L2TBINARIES_TRACK: "dev"

install:
- cmd: '"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x86 /release'
- cmd: "%PYTHON%\\python.exe -m pip install -U pip setuptools wheel"
- cmd: "%PYTHON%\\python.exe -m pip install pywin32 WMI"
- cmd: "%PYTHON%\\python.exe %PYTHON%\\Scripts\\pywin32_postinstall.py -install"
- cmd: git clone https://github.com/log2timeline/l2tdevtools.git ..\l2tdevtools
- cmd: IF [%PYTHON_VERSION%]==[3.8] (
    mkdir dependencies &&
    set PYTHONPATH=..\l2tdevtools &&
    "%PYTHON%\\python.exe" ..\l2tdevtools\tools\update.py --download-directory dependencies --machine-type %MACHINE_TYPE% --msi-targetdir "%PYTHON%" --track "%L2TBINARIES_TRACK%" PyYAML XlsxWriter artifacts bencode certifi cffi chardet cryptography dateutil defusedxml dfdatetime dfvfs dfwinreg dtfabric elasticsearch-py fakeredis future idna libbde libcreg libesedb libevt libevtx libewf libfsapfs libfsext libfsntfs libfvde libfwnt libfwsi liblnk libluksde libmsiecf libolecf libqcow libregf libscca libsigscan libsmdev libsmraw libvhdi libvmdk libvshadow libvslvm lz4 mock pbr pefile psutil pyparsing pytsk3 pytz pyzmq redis requests six sortedcontainers urllib3 yara-python )

build: off

test_script:
- cmd: IF [%TARGET%]==[unittests] (
    "%PYTHON%\\python.exe" run_tests.py &&
    IF EXIST "tests\\end-to-end.py" (
        set PYTHONPATH=. &&
        "%PYTHON%\\python.exe" "tests\\end-to-end.py" --debug -c "config\\end-to-end.ini" ) )
