environment:
  nodejs_version: "8"

# Install scripts. (runs after repo cloning)
install:
  # Get the latest stable version of Node.js or io.js
  - ps: Install-Product node $env:nodejs_version
  # - choco install imagemagick.tool --version "6.9.9.23" && refreshenv
  - choco install imagemagick.tool && refreshenv
  - npm install

# Post-install test scripts.
test_script:
  # Output useful info for debugging.
  - magick -version
  - node --version
  - npm --version
  - npm test

# We need the following test artifacts to debug rendering issues:
# This means thats we can debug the current test issues, which are that the
# convert command is not respecting opacity on windows. We need to script this
# as the 'artifacts' yaml section is only used on *successful* builds - we need
# the artifacts when we fail!
on_finish:
  - ps: $root = Resolve-Path .\src\label\test-images; [IO.Directory]::GetFiles($root.Path, '*.*', 'AllDirectories') | % { Push-AppveyorArtifact $_ -FileName $_.Substring($root.Path.Length + 1) -DeploymentName to-publish }
  - ps: $root = Resolve-Path .\src\resize\test-images; [IO.Directory]::GetFiles($root.Path, '*.*', 'AllDirectories') | % { Push-AppveyorArtifact $_ -FileName $_.Substring($root.Path.Length + 1) -DeploymentName to-publish }
  # Uncomment the line below to enable a remote desktop session to debug builds.
  # - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))

# Don't actually build (we do it ourselves).
build: off
