version: '1.0.{build}'

cache:
  - vendor/bundle

environment:
  RAILS_ENV: test
  COVERALLS_SERVICE_NAME: appveyor
  nodejs_version: "12"

services:
  - postgresql95
  
  # Install scripts. (runs after repo cloning)
install:
  - ps: Install-Product node $env:nodejs_version
  - set PATH=C:\Ruby26\bin;%PATH%
  - bundle config --local path vendor/bundle
  - bundle install --with postgresql
  - yarn

build: off

before_test:
  - ruby -v
  - gem -v
  - bundle -v
  - copy config\database.appveyor.yml config\database.yml
  - ruby bin\rake db:create
  - ruby bin\rails db:schema:load
  - openssl genrsa  -out config/private.pem 2048
  - openssl rsa -in config/private.pem -outform PEM -pubout -out config/public.pem


test_script:
  - bundle exec rspec --format RspecJunitFormatter --out test_results/rspec.xml --format progress --tag ~@skip_windows