environment:
  matrix:
    - ARCH: "x86_64"

branches:
  only:
    - master
    - /release-.*/

skip_commits:
  message: /\[av skip\]/

notifications:
  - provider: Email
    on_build_success: false
    on_build_failure: false
    on_build_status_changed: false

init:
  - git config --global core.autocrlf input

build_script:
  - ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod `
      https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | `
      Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { `
      throw "There are newer queued builds for this pull request, failing early." }
  - if %ARCH%==i686 ( set EXCEPT=dwarf ) else set EXCEPT=seh
  - if %ARCH%==i686 ( set MINGW=mingw32 ) else set MINGW=mingw64
  - set PATH=C:\MinGW-w64\%ARCH%-6.3.0-posix-%EXCEPT%-rt_v5-rev1\%MINGW%\bin;%PATH%
  - mingw32-make.exe ARCH=%ARCH% CC=%ARCH%-w64-mingw32-gcc
  - mingw32-make.exe test ARCH=%ARCH% CC=%ARCH%-w64-mingw32-gcc

on_finish:
  # Uncomment the following line for interactive debugging, which
  # will print login data for a temporary remote session after the
  # build. This requires an RDP version 6 client, e.g., FreeRDP.
  #- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
