<commit_before>version: 1.0.{build}
image: Visual Studio 2015

build: off

environment:
  global:
    # Avoid long paths on Windows
    STACK_ROOT: "c:\\s"
    STACK_WORK: ".w"
    WORK_DIR: "c:\\w"
    CACHE_S3_VERSION: v0.1.3
    AWS_REGION: us-west-1
    S3_BUCKET: appveyor-ci-cache
    AWS_ACCESS_KEY_ID:
      <KEY>
    AWS_SECRET_ACCESS_KEY:
      secure: m5sQYd16K8HA0zoZaD0gOl4EEWUso1D51L5rp+kT3hLaIE3tt4iT+b+iW8F4F0FU

init:
- ps: $env:CACHE_S3_READY = (("$env:CACHE_S3_VERSION" -ne "") -and ("$env:S3_BUCKET" -ne "") -and ("$env:AWS_ACCESS_KEY_ID" -ne "") -and ("$env:AWS_SECRET_ACCESS_KEY" -ne ""))

before_test:
# Avoid long paths not to each MAX_PATH of 260 chars
- xcopy /q /s /e /r /k /i /v /h /y "%APPVEYOR_BUILD_FOLDER%" "%WORK_DIR%"
- cd "%WORK_DIR%"
# Restore cache
- Echo %APPVEYOR_BUILD_VERSION% > build-id
- ps: >-
    if ( $env:CACHE_S3_READY -eq $true ) {
      Start-FileDownload https://github.com/fpco/cache-s3/releases/download/$env:CACHE_S3_VERSION/cache-s3-$env:CACHE_S3_VERSION-windows-x86_64.zip -FileName cache-s3.zip
      7z x cache-s3.zip cache-s3.exe
      .\cache-s3 --prefix=$env:APPVEYOR_PROJECT_NAME --git-branch=$env:APPVEYOR_REPO_BRANCH --suffix=windows -v info -c restore stack --base-branch=develop
      .\cache-s3 --prefix=$env:APPVEYOR_PROJECT_NAME --git-branch=$env:APPVEYOR_REPO_BRANCH --suffix=windows -v info -c restore stack work --base-branch=develop
    }

# Install OpenSSL 1.0.2 (see https://github.com/appveyor/ci/issues/1665)
- ps: (New-Object Net.WebClient).DownloadFile('https://slproweb.com/download/Win64OpenSSL-1_0_2n.exe', "$($env:USERPROFILE)\Win64OpenSSL.exe")
- ps: cmd /c start /wait "$($env:USERPROFILE)\Win64OpenSSL.exe" /silent /verysilent /sp- /suppressmsgboxes /DIR=C:\OpenSSL-Win64-v102
- ps: Install-Product node 6
# Install stack
- ps: Start-FileDownload http://www.stackage.org/stack/windows-x86_64 -FileName stack.zip
- 7z x stack.zip stack.exe


# Install rocksdb
- git clone https://github.com/facebook/rocksdb.git --branch v4.13.5
- ps: Start-FileDownload 'https://ci.appveyor.com/api/buildjobs/kbpteb8j55p6sa2m/artifacts/rocksdb%2Fbuild%2FRocksdb.zip' -FileName rocksdb.zip
- 7z x rocksdb.zip

# CSL-1509: After moving the 'cardano-sl' project itself into a separate folder ('lib/'), the 'cardano-text.exe' executable fails on AppVeyor CI.
# After some investigation, it was discovered that this was because 'rocksdb.dll' has to be located in this folder as well, or else the test executable doesn't work.
- copy rocksdb.dll lib
- copy rocksdb.dll wallet
- copy rocksdb.dll wallet-new

# Install liblzma/xz
- ps: Start-FileDownload https://tukaani.org/xz/xz-5.2.3-windows.zip -Filename xz-5.2.3-windows.zip
- 7z -oC:\xz_extracted x xz-5.2.3-windows.zip

test_script:
  - cd "%WORK_DIR%"
  - stack --verbosity warn setup --no-reinstall > nul
  # Install happy separately: https://github.com/commercialhaskell/stack/issues/3151#issuecomment-310642487. Also install cpphs because it's a build-tool and Stack can't figure out by itself that it should be installed
  - scripts\ci\appveyor-retry call stack --verbosity warn install happy cpphs<commit_msg>[DEVOPS-757] update openssl version on appveyor<commit_after>version: 1.0.{build}
image: Visual Studio 2015

build: off

environment:
  global:
    # Avoid long paths on Windows
    STACK_ROOT: "c:\\s"
    STACK_WORK: ".w"
    WORK_DIR: "c:\\w"
    CACHE_S3_VERSION: v0.1.3
    AWS_REGION: us-west-1
    S3_BUCKET: appveyor-ci-cache
    AWS_ACCESS_KEY_ID:
      secure: <KEY>
    AWS_SECRET_ACCESS_KEY:
      secure: m5sQYd16K8HA0zoZaD0gOl4EEWUso1D51L5rp+kT3hLaIE3tt4iT+b+iW8F4F0FU

init:
- ps: $env:CACHE_S3_READY = (("$env:CACHE_S3_VERSION" -ne "") -and ("$env:S3_BUCKET" -ne "") -and ("$env:AWS_ACCESS_KEY_ID" -ne "") -and ("$env:AWS_SECRET_ACCESS_KEY" -ne ""))

before_test:
# Avoid long paths not to each MAX_PATH of 260 chars
- xcopy /q /s /e /r /k /i /v /h /y "%APPVEYOR_BUILD_FOLDER%" "%WORK_DIR%"
- cd "%WORK_DIR%"
# Restore cache
- Echo %APPVEYOR_BUILD_VERSION% > build-id
- ps: >-
    if ( $env:CACHE_S3_READY -eq $true ) {
      Start-FileDownload https://github.com/fpco/cache-s3/releases/download/$env:CACHE_S3_VERSION/cache-s3-$env:CACHE_S3_VERSION-windows-x86_64.zip -FileName cache-s3.zip
      7z x cache-s3.zip cache-s3.exe
      .\cache-s3 --prefix=$env:APPVEYOR_PROJECT_NAME --git-branch=$env:APPVEYOR_REPO_BRANCH --suffix=windows -v info -c restore stack --base-branch=develop
      .\cache-s3 --prefix=$env:APPVEYOR_PROJECT_NAME --git-branch=$env:APPVEYOR_REPO_BRANCH --suffix=windows -v info -c restore stack work --base-branch=develop
    }

# Install OpenSSL 1.0.2 (see https://github.com/appveyor/ci/issues/1665)
- ps: (New-Object Net.WebClient).DownloadFile('https://slproweb.com/download/Win64OpenSSL-1_0_2o.exe', "$($env:USERPROFILE)\Win64OpenSSL.exe")
- ps: cmd /c start /wait "$($env:USERPROFILE)\Win64OpenSSL.exe" /silent /verysilent /sp- /suppressmsgboxes /DIR=C:\OpenSSL-Win64-v102
- ps: Install-Product node 6
# Install stack
- ps: Start-FileDownload http://www.stackage.org/stack/windows-x86_64 -FileName stack.zip
- 7z x stack.zip stack.exe


# Install rocksdb
- git clone https://github.com/facebook/rocksdb.git --branch v4.13.5
- ps: Start-FileDownload 'https://ci.appveyor.com/api/buildjobs/kbpteb8j55p6sa2m/artifacts/rocksdb%2Fbuild%2FRocksdb.zip' -FileName rocksdb.zip
- 7z x rocksdb.zip

# CSL-1509: After moving the 'cardano-sl' project itself into a separate folder ('lib/'), the 'cardano-text.exe' executable fails on AppVeyor CI.
# After some investigation, it was discovered that this was because 'rocksdb.dll' has to be located in this folder as well, or else the test executable doesn't work.
- copy rocksdb.dll lib
- copy rocksdb.dll wallet
- copy rocksdb.dll wallet-new

# Install liblzma/xz
- ps: Start-FileDownload https://tukaani.org/xz/xz-5.2.3-windows.zip -Filename xz-5.2.3-windows.zip
- 7z -oC:\xz_extracted x xz-5.2.3-windows.zip

test_script:
  - cd "%WORK_DIR%"
  - stack --verbosity warn setup --no-reinstall > nul
  # Install happy separately: https://github.com/commercialhaskell/stack/issues/3151#issuecomment-310642487. Also install cpphs because it's a build-tool and Stack can't figure out by itself that it should be installed
  - scripts\ci\appveyor-retry call stack --verbosity warn install happy cpphs
{'fraction_non_alphanumeric': 0.13665187064045656, 'fraction_numerical': 0.03725428027901078, 'mean_word_length': 3.8831269349845203, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 14, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5671723', 'n_tokens_mistral': 2569, 'n_tokens_neox': 2428, 'n_words': 537}