language: perl
os:
  - linux
#  - osx    #doesn’t install the correct perl
perl:
  - "5.28"
  - "5.26"
  - "5.24"
  - "5.22"
  - "5.20"
  - "5.18"
  - "5.16"
  - "5.14"
  - "5.12"
  - "5.10"

before_install:
    - cpanm ExtUtils::MakeMaker

jobs:
  include:
    - os: osx
      perl: system
      before_install:
        - "curl -L http://cpanmin.us | perl - --self-upgrade"
        - export PATH=$PATH:$HOME/perl5/bin
        - "cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)"

    # First instance of "stage: Strawberry" creates alias and tests 5.28.1.1.
    - &strawberry
      stage: Strawberry
      os: windows
      language: shell
      env: PERL_VERSION=5.28.1.1
      before_install:
        - cinst -y strawberryperl --version $PERL_VERSION
        - export "PATH=/c/Strawberry/perl/site/bin:/c/Strawberry/perl/bin:/c/Strawberry/c/bin:$PATH"
        - cpanm ExtUtils::MakeMaker
      install:
        - cpanm --notest --installdeps .
      script:
        - perl Makefile.PL
        - gmake
        - gmake test

    # Subsequent instances use the alias to test different versions.
    - <<: *strawberry
      env: PERL_VERSION=5.26.3.1
#    - <<: *strawberry
#      env: PERL_VERSION=5.24.4.1
#    - <<: *strawberry
#      env: PERL_VERSION=5.22.3.1
#    - <<: *strawberry
#      env: PERL_VERSION=5.20.3.3
#    - <<: *strawberry
#      env: PERL_VERSION=5.18.4.1
#    - <<: *strawberry
#      env: PERL_VERSION=5.16.3.3
#    - <<: *strawberry
#      env: PERL_VERSION=5.14.4.1
#    - <<: *strawberry
#      env: PERL_VERSION=5.12.3.1
#    - <<: *strawberry
#      env: PERL_VERSION=5.10.1.5
#    - <<: *strawberry
#      env: PERL_VERSION=5.8.9.5