image: Visual Studio 2019

branches:
  only:
  - main

skip_branch_with_pr: true

clone_depth: 1

cache:
  - vendor/bundle
  - ports/archives

install:
  - SET PATH=C:\ruby%ruby_version%\bin;%PATH%
  - ps: |
      if ($env:ruby_version -like "*head*") {
        $(new-object net.webclient).DownloadFile("https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-head/rubyinstaller-$env:ruby_version.exe", "$pwd/ruby-setup.exe")
        cmd /c ruby-setup.exe /verysilent /dir=C:/Ruby$env:ruby_version
      }
  - ruby --version
  - gem --version
  - gem install bundler --conservative
  - git submodule update --init
  - bundle config --local path vendor/bundle
  - bundle install
  - IF DEFINED INSTALL_PACKAGES ( ridk exec pacman --noconfirm --needed --sync %INSTALL_PACKAGES% )

build: off

test_script:
  - bundle exec rake -rdevkit compile test -- %EXTCONF_PARAMS%

environment:
  matrix:
    - ruby_version: 30
    - ruby_version: 30
      INSTALL_PACKAGES: "mingw-w64-i686-libxslt"
      EXTCONF_PARAMS: "--use-system-libraries"

    - ruby_version: 26
    - ruby_version: 26
      INSTALL_PACKAGES: "mingw-w64-i686-libxslt"
      EXTCONF_PARAMS: "--use-system-libraries"
