# http://www.appveyor.com/docs/appveyor-yml

# Set build version format here instead of in the admin panel
version: '{build}'

# Do not build on gh tags
skip_tags: true

# Test against these versions of Node.js
environment:
  matrix:
    # Node versions to run
    - nodejs_version: 'Current'
    - nodejs_version: 'LTS'

# Fix line endings in Windows. (runs before repo cloning)
init:
  - git config --global core.autocrlf input

# Install scripts--runs after repo cloning
install:
  # Install the latest stable version of Node
  - ps: Install-Product node $env:nodejs_version
  - npm ci

# Disable automatic builds
build: off

# Post-install test scripts
test_script:
  # Output debugging info
  - node --version
  - node ./internals/scripts/generate-templates-for-linting
  # run tests and run build
  - npm run test
  - npm run build

# Cache node_modules for faster builds
cache:
  - node_modules -> package.json

# remove, as appveyor doesn't support secure variables on pr builds
# so `COVERALLS_REPO_TOKEN` cannot be set, without hard-coding in this file
#on_success:
#- npm run coveralls