# appveyor file
# http://www.appveyor.com/docs/appveyor-yml

# Try out "interactive-mode"
os: Windows Server 2012 R2

# build version format
version: "{build}-{branch}"

# Set a known clone folder
clone_folder: C:\projects\unittest

# environments
environment:
  oauthtoken:
    secure: Pqn9WKVpsBrDqhg5l2L7FeBGCdhmTipBkGOSb1Q3xb91KbnK8f8b/bYuc//y/Rte

# branches
branches:
  only:
    - main
    - master
    - develop

# fix lineendings in Windows
init:
  - git config --global core.autocrlf input
  - git config --global user.name "Tomoya Koyanagi"
  - git config --global user.email tomk79@gmail.com


# Install scripts
install:
  ## Set PHP.
  - ps: Set-Service wuauserv -StartupType Manual
  - cinst php --version 8.1.4 -y
  - SET PATH=C:\tools\php81\;%PATH%
  - cd C:\tools\php81
  - copy php.ini-production php.ini
  - echo date.timezone="Asia/Tokyo" >> php.ini
  - echo extension_dir=ext >> php.ini
  - echo extension=php_openssl.dll >> php.ini
  - echo extension=php_gd.dll >> php.ini
  - echo extension=php_mbstring.dll >> php.ini
  - echo extension=php_curl.dll >> php.ini
  - echo extension=php_xsl.dll >> php.ini
  - echo extension=php_intl.dll >> php.ini
  - echo extension=php_pdo_sqlite.dll >> php.ini
  - echo output_buffering = Off >> php.ini
  - echo default_charset = UTF-8 >> php.ini
  - echo mbstring.language = Japanese >> php.ini
  - echo mbstring.encoding_translation = On >> php.ini
  - echo mbstring.http_input = UTF-8 >> php.ini
  - echo mbstring.http_output = pass >> php.ini
  - echo mbstring.internal_encoding = UTF-8 >> php.ini

  - php -v
  - where php


  ## Set Composer.
  - cd C:\projects\unittest
  - php -r "readfile('https://getcomposer.org/installer');" | php
  - php composer.phar --version
  - php composer.phar config -g github-oauth.github.com %oauthtoken%



build_script:
  - php composer.phar install
  - php vendor\phpunit\phpunit\phpunit



test: off
deploy: off


notifications:
  # Email
  - provider: Email
    to:
      - tomk79@gmail.com
    on_build_status_changed: true
